diff options
Diffstat (limited to 'neutron/plugins/ml2/plugin.py')
-rw-r--r-- | neutron/plugins/ml2/plugin.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/neutron/plugins/ml2/plugin.py b/neutron/plugins/ml2/plugin.py index 52d9cf0215..6301a003ef 100644 --- a/neutron/plugins/ml2/plugin.py +++ b/neutron/plugins/ml2/plugin.py @@ -690,6 +690,14 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2, # transaction that completed before the deletion. LOG.debug("Port %s has been deleted concurrently", port_id) return orig_context, False, False + + if (new_binding.status == const.INACTIVE and + new_binding.host == cur_binding.host): + # The binding is already active on the target host, + # probably because of a concurrent activate request. + raise exc.PortBindingAlreadyActive(port_id=port_id, + host=new_binding.host) + # Since the mechanism driver bind_port() calls must be made # outside a DB transaction locking the port state, it is # possible (but unlikely) that the port's state could change |