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
This commit is contained in:
parent
a0d05fd8cf
commit
cb6eae20fa
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user