Browse Source

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 f5e3a665f7fcaebd99bcd2d0bdc9cf58b3a29782)
changes/17/782717/1
François Rigault 3 weeks ago
committed by Dmitry Tantsur
parent
commit
995febc0ed
4 changed files with 5 additions and 5 deletions
  1. +1
    -1
      ironic_inspector/plugins/base_physnet.py
  2. +1
    -1
      ironic_inspector/plugins/local_link_connection.py
  3. +1
    -1
      ironic_inspector/test/unit/test_plugins_local_link_connection.py
  4. +2
    -2
      ironic_inspector/test/unit/test_plugins_physnet_cidr_map.py

+ 1
- 1
ironic_inspector/plugins/base_physnet.py View File

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

+ 1
- 1
ironic_inspector/plugins/local_link_connection.py View File

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

+ 1
- 1
ironic_inspector/test/unit/test_plugins_local_link_connection.py View File

@ -51,7 +51,7 @@ class TestGenericLocalLinkConnectionHook(test_base.NodeTest):
'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)
for a in ('11:11:11:11:11:11',)]
self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,


+ 2
- 2
ironic_inspector/test/unit/test_plugins_physnet_cidr_map.py 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',)]
self.node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,
node=self.node, ports=ports)
@ -113,7 +113,7 @@ class TestPhysnetCidrMapHook(test_base.NodeTest):
@mock.patch.object(node_cache.NodeInfo, 'patch_port', autospec=True)
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')
for a in ('11:11:11:11:11:11',)]
node_info = node_cache.NodeInfo(uuid=self.uuid, started_at=0,


Loading…
Cancel
Save