From: Kevin Benton Date: Wed, 3 Jun 2015 05:52:51 +0000 (+0000) Subject: Revert "Add VIF_DELETED notification event to Nova" X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=6575db592c92791a51540134192bc86465940283;p=openstack-build%2Fneutron-build.git Revert "Add VIF_DELETED notification event to Nova" We need to wait until the nova support is added in I998b6bb80cc0a81d665b61b8c4a424d7219c666f. Otherwise this generates a ton of error messages in the nova api log as well as on the neutron side. This reverts commit 0ace88fd4a75ff213dc36fd16c1f8e7080ab7d6d. Change-Id: I129c4e4c05cf07d45032fec6f57e0cc17a5a82af Closes-Bug: #1461391 --- diff --git a/neutron/notifiers/nova.py b/neutron/notifiers/nova.py index 86e4a7408..4bad6dcba 100644 --- a/neutron/notifiers/nova.py +++ b/neutron/notifiers/nova.py @@ -35,7 +35,6 @@ LOG = logging.getLogger(__name__) VIF_UNPLUGGED = 'network-vif-unplugged' VIF_PLUGGED = 'network-vif-plugged' -VIF_DELETED = 'network-vif-deleted' NEUTRON_NOVA_EVENT_STATUS_MAP = {constants.PORT_STATUS_ACTIVE: 'completed', constants.PORT_STATUS_ERROR: 'failed', constants.PORT_STATUS_DOWN: 'completed'} @@ -122,11 +121,6 @@ class Notifier(object): return {'name': 'network-changed', 'server_uuid': device_id} - def _get_port_delete_event(self, port): - return {'server_uuid': port['device_id'], - 'name': VIF_DELETED, - 'tag': port['id']} - @property def _plugin(self): # NOTE(arosen): this cannot be set in __init__ currently since @@ -166,7 +160,7 @@ class Notifier(object): def create_port_changed_event(self, action, original_obj, returned_obj): port = None - if action in ['update_port', 'delete_port']: + if action == 'update_port': port = returned_obj['port'] elif action in ['update_floatingip', 'create_floatingip', @@ -184,10 +178,7 @@ class Notifier(object): port = self._plugin.get_port(ctx, port_id) if port and self._is_compute_port(port): - if action == 'delete_port': - return self._get_port_delete_event(port) - else: - return self._get_network_changed_event(port['device_id']) + return self._get_network_changed_event(port['device_id']) def record_port_status_changed(self, port, current_port_status, previous_port_status, initiator): diff --git a/neutron/tests/unit/notifiers/test_nova.py b/neutron/tests/unit/notifiers/test_nova.py index b04e26257..49ccb975a 100644 --- a/neutron/tests/unit/notifiers/test_nova.py +++ b/neutron/tests/unit/notifiers/test_nova.py @@ -290,18 +290,3 @@ class TestNovaNotify(base.BaseTestCase): self.nova_notifier.batch_notifier.pending_events[0], event_dis) self.assertEqual( self.nova_notifier.batch_notifier.pending_events[1], event_assoc) - - def test_delete_port_notify(self): - device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87' - port_id = 'bee50827-bcee-4cc8-91c1-a27b0ce54222' - returned_obj = {'port': - {'device_owner': 'compute:dfd', - 'id': port_id, - 'device_id': device_id}} - - expected_event = {'server_uuid': device_id, - 'name': nova.VIF_DELETED, - 'tag': port_id} - event = self.nova_notifier.create_port_changed_event('delete_port', - {}, returned_obj) - self.assertEqual(expected_event, event)