Use port.id instead of port.uuid

This is a follow-up for extra issues identified during code review of
Ib4978f5e3e4f1b64faa1bfae3cdcf46199bb2f21

Story: 2008698
Task: 42099
Change-Id: Ic18d42209d0f0f7c12ab0972dba2b97bb93b7c4e
(cherry picked from commit f5e3a665f7)
This commit is contained in:
François Rigault 2021-03-23 19:17:01 +01:00 committed by Dmitry Tantsur
parent 6a668c65aa
commit 995febc0ed
4 changed files with 5 additions and 5 deletions

View File

@ -99,5 +99,5 @@ class BasePhysnetHook(base.ProcessingHook):
node_info.patch_port(port, [patch]) node_info.patch_port(port, [patch])
except exceptions.BadRequestException as e: except exceptions.BadRequestException as e:
LOG.warning("Failed to update port %(uuid)s: %(error)s", LOG.warning("Failed to update port %(uuid)s: %(error)s",
{'uuid': port.uuid, 'error': e}, {'uuid': port.id, 'error': e},
node_info=node_info) node_info=node_info)

View File

@ -161,5 +161,5 @@ class GenericLocalLinkConnectionHook(base.ProcessingHook):
node_info.patch_port(port, patches) node_info.patch_port(port, patches)
except exceptions.BadRequestException as e: except exceptions.BadRequestException as e:
LOG.warning("Failed to update port %(uuid)s: %(error)s", LOG.warning("Failed to update port %(uuid)s: %(error)s",
{'uuid': port.uuid, 'error': e}, {'uuid': port.id, 'error': e},
node_info=node_info) node_info=node_info)

View File

@ -51,7 +51,7 @@ class TestGenericLocalLinkConnectionHook(test_base.NodeTest):
'port_id': '56' 'port_id': '56'
} }
ports = [mock.Mock(spec=['address', 'uuid', 'local_link_connection'], ports = [mock.Mock(spec=['address', 'id', 'local_link_connection'],
address=a, local_link_connection=llc) address=a, local_link_connection=llc)
for a in ('11:11:11:11:11:11',)] for a in ('11:11:11:11:11:11',)]
self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,

View File

@ -43,7 +43,7 @@ class TestPhysnetCidrMapHook(test_base.NodeTest):
} }
} }
ports = [mock.Mock(spec=['address', 'uuid', 'physical_network'], ports = [mock.Mock(spec=['address', 'id', 'physical_network'],
address=a) for a in ('11:11:11:11:11:11',)] address=a) for a in ('11:11:11:11:11:11',)]
self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,
node=self.node, ports=ports) node=self.node, ports=ports)
@ -113,7 +113,7 @@ class TestPhysnetCidrMapHook(test_base.NodeTest):
@mock.patch.object(node_cache.NodeInfo, 'patch_port', autospec=True) @mock.patch.object(node_cache.NodeInfo, 'patch_port', autospec=True)
def test_no_overwrite(self, mock_patch): def test_no_overwrite(self, mock_patch):
ports = [mock.Mock(spec=['address', 'uuid', 'physical_network'], ports = [mock.Mock(spec=['address', 'id', 'physical_network'],
address=a, physical_network='foo') address=a, physical_network='foo')
for a in ('11:11:11:11:11:11',)] for a in ('11:11:11:11:11:11',)]
node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0, node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,