summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2014-11-27 03:43:16 +0000
committerGerrit Code Review <review@openstack.org>2014-11-27 03:43:16 +0000
commit92c23f1f6d1e9d80ea2534233ef48a56f5bbe8d2 (patch)
tree73c7a34f4b26984accd58967ce2a69f57dd2bbc5
parent4e4110b166c49ce913b6226c53e5885407403ddf (diff)
parent3e1d3a786500510be7338ce9e5c81e8daccfeb40 (diff)
downloadneutron-92c23f1f6d1e9d80ea2534233ef48a56f5bbe8d2.tar.gz
Merge "Prevent an iteration through ports on IPv6 slaac" into stable/juno
-rw-r--r--neutron/plugins/ml2/plugin.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py
index fe3a6face8..26d2c98a3a 100644
--- a/neutron/plugins/ml2/plugin.py
+++ b/neutron/plugins/ml2/plugin.py
@@ -725,11 +725,9 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
filter_by(network_id=subnet['network_id']).
with_lockmode('update').all())
LOG.debug(_("Ports to auto-deallocate: %s"), allocated)
- only_auto_del = all(not a.port_id or
- a.ports.device_owner in db_base_plugin_v2.
- AUTO_DELETE_PORT_OWNERS or
- ipv6_utils.is_slaac_subnet(subnet)
- for a in allocated)
+ only_auto_del = ipv6_utils.is_slaac_subnet(subnet) or all(
+ not a.port_id or a.ports.device_owner in db_base_plugin_v2.
+ AUTO_DELETE_PORT_OWNERS for a in allocated)
if not only_auto_del:
LOG.debug(_("Tenant-owned ports exist"))
raise exc.SubnetInUse(subnet_id=id)