From: Aaron Rosen Date: Mon, 20 Apr 2015 19:45:12 +0000 (-0700) Subject: _create_subnet_from_implicit_pool assumes external network extension X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bde4f6f767d3da4c3eca15390ea45a934f2ff398;p=openstack-build%2Fneutron-build.git _create_subnet_from_implicit_pool assumes external network extension network.external is only present if one is using the external_net_db mixin. This patch just adds a check to see network has the attribute external to avoid an Attribute error. Closes-bug: 1441793 Change-Id: Ic003879b557a8c7ab52268a95d08d6d710618438 --- diff --git a/neutron/db/db_base_plugin_v2.py b/neutron/db/db_base_plugin_v2.py index 714d189e8..b801fd57a 100644 --- a/neutron/db/db_base_plugin_v2.py +++ b/neutron/db/db_base_plugin_v2.py @@ -1260,7 +1260,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2, s['dns_nameservers'], s['host_routes'], s['allocation_pools']) - if network.external: + if hasattr(network, 'external') and network.external: self._update_router_gw_ports(context, subnet['id'], subnet['network_id']) @@ -1286,7 +1286,7 @@ class NeutronDbPluginV2(neutron_plugin_base_v2.NeutronPluginBaseV2, s['dns_nameservers'], s['host_routes'], s['allocation_pools']) - if network.external: + if hasattr(network, 'external') and network.external: self._update_router_gw_ports(context, subnet['id'], subnet['network_id'])