Merge "Remove baremetal notification from nova notifier"
This commit is contained in:
commit
01baa8c541
@ -87,9 +87,8 @@ class Notifier(object):
|
|||||||
def _is_compute_port(self, port):
|
def _is_compute_port(self, port):
|
||||||
try:
|
try:
|
||||||
if (port['device_id'] and uuidutils.is_uuid_like(port['device_id'])
|
if (port['device_id'] and uuidutils.is_uuid_like(port['device_id'])
|
||||||
and port['device_owner'].startswith((
|
and port['device_owner'].startswith(
|
||||||
constants.DEVICE_OWNER_COMPUTE_PREFIX,
|
constants.DEVICE_OWNER_COMPUTE_PREFIX)):
|
||||||
constants.DEVICE_OWNER_BAREMETAL_PREFIX))):
|
|
||||||
return True
|
return True
|
||||||
except (KeyError, AttributeError):
|
except (KeyError, AttributeError):
|
||||||
pass
|
pass
|
||||||
|
@ -324,21 +324,6 @@ class TestNovaNotify(base.BaseTestCase):
|
|||||||
{}, returned_obj)
|
{}, returned_obj)
|
||||||
self.assertEqual(expected_event, event)
|
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')
|
@mock.patch('novaclient.client.Client')
|
||||||
def test_endpoint_types(self, mock_client):
|
def test_endpoint_types(self, mock_client):
|
||||||
nova.Notifier()
|
nova.Notifier()
|
||||||
|
Loading…
Reference in New Issue
Block a user