diff options
author | rossella <rsblendido@suse.com> | 2016-07-02 18:15:32 +0000 |
---|---|---|
committer | rossella <rsblendido@suse.com> | 2016-07-06 11:14:07 +0000 |
commit | 6e275e38575981386508718bf31e6f88b5a0887d (patch) | |
tree | 417ec52a39bad70bffbb238daec1a753f35a6a7a /neutron/notifiers | |
parent | 78dc79146f0c9714a3313c9d340b3cf5102c538a (diff) | |
download | neutron-6e275e38575981386508718bf31e6f88b5a0887d.tar.gz |
When deleting floating IP catch PortNotFound
If we try to delete a VM and to delete the floating IP
associated with the VM at the same time, depending
on the order according to which these requests are processed
Neutron might fail in the deletion of the floating IP,
raising a PortNotFound error. This happens because Neutron
notifies Nova of the network change event and it tries to get
the port to which the FIP is associated. If the port is not there,
Neutron shouldn't raise, it shouldn't send any notification.
Change-Id: Ic72313ad1f787b3cb528e806c843f1fd01eb12f2
Closes-bug: #1586931
Diffstat (limited to 'neutron/notifiers')
-rw-r--r-- | neutron/notifiers/nova.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/neutron/notifiers/nova.py b/neutron/notifiers/nova.py index 05da97f877..551894aaa6 100644 --- a/neutron/notifiers/nova.py +++ b/neutron/notifiers/nova.py @@ -15,6 +15,7 @@ from keystoneauth1 import loading as ks_loading from neutron_lib import constants +from neutron_lib import exceptions as exc from novaclient import client as nova_client from novaclient import exceptions as nova_exceptions from oslo_config import cfg @@ -158,7 +159,12 @@ class Notifier(object): return ctx = context.get_admin_context() - port = self._plugin.get_port(ctx, port_id) + try: + port = self._plugin.get_port(ctx, port_id) + except exc.PortNotFound: + LOG.debug("Port %s was deleted, no need to send any " + "notification", port_id) + return if port and self._is_compute_port(port): if action == 'delete_port': |