Scheduler of decision_engine fix

This patch set renames 'OS-EXT-STS:instance_state' to 'OS-EXT-STS:vm_state'
for correct working of decision_engine scheduler.

Change-Id: I20805a079a991d5f3b8565f52d5f7280c2389bee
Closes-Bug: #1614511
This commit is contained in:
Viacheslav Samarin
2016-08-18 16:31:07 +03:00
parent efdf6c93fc
commit 01164b0790
2 changed files with 2 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ class NovaClusterDataModelCollector(base.BaseClusterDataModelCollector):
instance = element.Instance()
instance.uuid = v.id
# nova/nova/compute/instance_states.py
instance.state = getattr(v, 'OS-EXT-STS:instance_state')
instance.state = getattr(v, 'OS-EXT-STS:vm_state')
# set capacity
self.wrapper.get_flavor_instance(v, flavor_cache)

View File

@@ -47,7 +47,7 @@ class TestNovaClusterDataModelCollector(base.TestCase):
)
fake_instance = mock.Mock(
id='ef500f7e-dac8-470f-960c-169486fce71b',
state=mock.Mock(**{'OS-EXT-STS:instance_state': 'VM_STATE'}),
state=mock.Mock(**{'OS-EXT-STS:vm_state': 'VM_STATE'}),
flavor={'ram': 333, 'disk': 222, 'vcpus': 4},
)
m_nova_helper.get_compute_node_list.return_value = [fake_compute_node]