Merge "ironic: delete cpu_info data from get_available_resource"

This commit is contained in:
Jenkins 2015-01-06 17:26:23 +00:00 committed by Gerrit Code Review
commit 2e2c2048bd
3 changed files with 7 additions and 3 deletions

View File

@ -104,7 +104,7 @@ class IronicHostManager(host_manager.HostManager):
def host_state_cls(self, host, node, **kwargs):
"""Factory function/property to create a new HostState."""
compute = kwargs.get('compute')
if compute and compute.get('cpu_info') == 'baremetal cpu':
if compute and compute.get('hypervisor_type') == 'ironic':
return IronicNodeState(host, node, **kwargs)
else:
return host_manager.HostState(host, node, **kwargs)

View File

@ -108,7 +108,7 @@ class IronicHostManagerChangedNodesTestCase(test.NoDBTestCase):
@mock.patch.object(ironic_host_manager.IronicNodeState, '__init__')
def test_create_ironic_node_state(self, init_mock):
init_mock.return_value = None
compute = {'cpu_info': 'baremetal cpu'}
compute = {'hypervisor_type': 'ironic'}
host_state = self.host_manager.host_state_cls('fake-host', 'fake-node',
compute=compute)
self.assertIs(ironic_host_manager.IronicNodeState, type(host_state))

View File

@ -254,7 +254,11 @@ class IronicDriver(virt_driver.ComputeDriver):
'hypervisor_hostname': str(node.uuid),
'hypervisor_type': self._get_hypervisor_type(),
'hypervisor_version': self._get_hypervisor_version(),
'cpu_info': 'baremetal cpu',
# The Ironic driver manages multiple hosts, so there are
# likely many different CPU models in use. As such it is
# impossible to provide any meaningful info on the CPU
# model of the "host"
'cpu_info': None,
'vcpus': vcpus,
'vcpus_used': vcpus_used,
'local_gb': local_gb,