Merge "Log compute node uuid when the record is created"

This commit is contained in:
Jenkins 2017-07-20 12:12:40 +00:00 committed by Gerrit Code Review
commit 4e8d2a329b
2 changed files with 6 additions and 4 deletions

View File

@ -528,9 +528,9 @@ class ResourceTracker(object):
self._copy_resources(cn, resources)
self.compute_nodes[nodename] = cn
cn.create()
LOG.info('Compute_service record created for '
'%(host)s:%(node)s',
{'host': self.host, 'node': nodename})
LOG.info('Compute node record created for '
'%(host)s:%(node)s with uuid: %(uuid)s',
{'host': self.host, 'node': nodename, 'uuid': cn.uuid})
self._setup_pci_tracker(context, cn, resources)
self._update(context, cn)

View File

@ -1067,7 +1067,8 @@ class TestInitComputeNode(BaseTestCase):
cpu_allocation_ratio=1.0,
disk_allocation_ratio=1.0,
stats={},
pci_device_pools=objects.PciDevicePoolList(objects=[])
pci_device_pools=objects.PciDevicePoolList(objects=[]),
uuid=uuids.compute_node_uuid
)
def set_cn_id():
@ -1076,6 +1077,7 @@ class TestInitComputeNode(BaseTestCase):
# 'id' in base class error
cn = self.rt.compute_nodes[_NODENAME]
cn.id = 42 # Has to be a number, not a mock
cn.uuid = uuids.compute_node_uuid
create_mock.side_effect = set_cn_id
self.rt._init_compute_node(mock.sentinel.ctx, resources)