From cb6eae20fae1f5e46cb2af4f0b0dc5368074580b Mon Sep 17 00:00:00 2001 From: Sam Betts Date: Mon, 23 Jan 2017 17:02:01 +0000 Subject: [PATCH] Remove baremetal notification from nova notifier This is a revert of change I3d53bff8278dabafd929ecbea0b4b3b441c9e1cf The nova notifier was updated to notify nova on ports with the baremetal: device_owner, these ports are owned by Ironic not Nova, so nova is getting notifications that it doesn't understand. Change-Id: I8318a682163f6a5b739be68ce56973c43d0e32f2 Closes-Bug: #1656010 Depends-On: I43c3af9f424a65211ef5a39f13e4810072997339 --- neutron/notifiers/nova.py | 5 ++--- neutron/tests/unit/notifiers/test_nova.py | 15 --------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/neutron/notifiers/nova.py b/neutron/notifiers/nova.py index dec1270b667..753f304fa48 100644 --- a/neutron/notifiers/nova.py +++ b/neutron/notifiers/nova.py @@ -85,9 +85,8 @@ class Notifier(object): def _is_compute_port(self, port): try: if (port['device_id'] and uuidutils.is_uuid_like(port['device_id']) - and port['device_owner'].startswith(( - constants.DEVICE_OWNER_COMPUTE_PREFIX, - constants.DEVICE_OWNER_BAREMETAL_PREFIX))): + and port['device_owner'].startswith( + constants.DEVICE_OWNER_COMPUTE_PREFIX)): return True except (KeyError, AttributeError): pass diff --git a/neutron/tests/unit/notifiers/test_nova.py b/neutron/tests/unit/notifiers/test_nova.py index c6599405b24..49143a8a040 100644 --- a/neutron/tests/unit/notifiers/test_nova.py +++ b/neutron/tests/unit/notifiers/test_nova.py @@ -323,21 +323,6 @@ class TestNovaNotify(base.BaseTestCase): {}, returned_obj) self.assertEqual(expected_event, event) - def test_delete_baremetal_port_notify(self): - device_id = '32102d7b-1cf4-404d-b50a-97aae1f55f87' - port_id = 'bee50827-bcee-4cc8-91c1-a27b0ce54222' - returned_obj = {'port': - {'device_owner': DEVICE_OWNER_BAREMETAL, - '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) - @mock.patch('novaclient.client.Client') def test_endpoint_types(self, mock_client): nova.Notifier()