]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Revert "Add VIF_DELETED notification event to Nova"
authorKevin Benton <kevinbenton@buttewifi.com>
Wed, 3 Jun 2015 05:52:51 +0000 (05:52 +0000)
committerKevin Benton <kevinbenton@buttewifi.com>
Wed, 3 Jun 2015 05:52:51 +0000 (05:52 +0000)
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

neutron/notifiers/nova.py
neutron/tests/unit/notifiers/test_nova.py

index 86e4a74088c7f68ac8f0c8f4162a7203ce74ec59..4bad6dcbadd4de902aaf33d4f3ec8946f6965044 100644 (file)
@@ -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):
index b04e26257816f995e0f6711b736003396362b600..49ccb975ae7d5a851ba9619d630d949535856dba 100644 (file)
@@ -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)