]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
_create_subnet_from_implicit_pool assumes external network extension
authorAaron Rosen <aaronorosen@gmail.com>
Mon, 20 Apr 2015 19:45:12 +0000 (12:45 -0700)
committerAaron Rosen <aaronorosen@gmail.com>
Mon, 20 Apr 2015 19:46:34 +0000 (12:46 -0700)
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

neutron/db/db_base_plugin_v2.py

index 714d189e81fb84966f248c6fec5c5ca46caf1253..b801fd57a38ce5e6c890ab3cf842685c031f1e0a 100644 (file)
@@ -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'])