Merge "Add missing stats to IronicNodeState"
This commit is contained in:
commit
172203ed3b
@ -22,6 +22,7 @@ subdivided into multiple instances.
|
||||
"""
|
||||
from oslo.config import cfg
|
||||
|
||||
from nova.openstack.common import jsonutils
|
||||
from nova.openstack.common import log as logging
|
||||
from nova.openstack.common import timeutils
|
||||
from nova.scheduler import host_manager
|
||||
@ -70,6 +71,9 @@ class IronicNodeState(host_manager.HostState):
|
||||
self.vcpus_total = compute['vcpus']
|
||||
self.vcpus_used = compute['vcpus_used']
|
||||
|
||||
stats = compute.get('stats', '{}')
|
||||
self.stats = jsonutils.loads(stats)
|
||||
|
||||
self.updated = compute['updated_at']
|
||||
|
||||
def consume_from_instance(self, instance):
|
||||
|
@ -128,6 +128,8 @@ class IronicHostManagerChangedNodesTestCase(test.NoDBTestCase):
|
||||
self.assertEqual(10240, host.free_disk_mb)
|
||||
self.assertEqual(1, host.vcpus_total)
|
||||
self.assertEqual(0, host.vcpus_used)
|
||||
self.assertEqual(jsonutils.loads(self.compute_node['stats']),
|
||||
host.stats)
|
||||
|
||||
def test_consume_identical_instance_from_compute(self):
|
||||
host = ironic_host_manager.IronicNodeState("fakehost", "fakenode")
|
||||
|
Loading…
x
Reference in New Issue
Block a user