fix Keyerror in test_nova_cdmc

fix keyerror in watcher.tests.decision_engine.cluster.test_nova_cdmc.
TestNovaClusterDataModelCollector.test_nova_cdmc_execute

Change-Id: I44810ae539d8783173dfbb9dd462101e21025802
Closes-Bug: #1698123
This commit is contained in:
Yumeng_Bao 2017-06-15 19:08:59 +08:00
parent 986ba9872f
commit 2db279e019

View File

@ -57,6 +57,7 @@ class TestNovaClusterDataModelCollector(base.TestCase):
metadata={'hi': 'hello'},
)
setattr(fake_instance, 'OS-EXT-STS:vm_state', 'VM_STATE')
setattr(fake_instance, 'OS-EXT-SRV-ATTR:host', 'test_hostname')
m_nova_helper.get_compute_node_list.return_value = [fake_compute_node]
# m_nova_helper.get_instances_by_node.return_value = [fake_instance]
m_nova_helper.get_instance_list.return_value = [fake_instance]