From 2db279e0197b0ee8d43ece65f26e341596496e6b Mon Sep 17 00:00:00 2001 From: Yumeng_Bao Date: Thu, 15 Jun 2017 19:08:59 +0800 Subject: [PATCH] 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 --- watcher/tests/decision_engine/cluster/test_nova_cdmc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/watcher/tests/decision_engine/cluster/test_nova_cdmc.py b/watcher/tests/decision_engine/cluster/test_nova_cdmc.py index 6f975bcac..a6857667e 100644 --- a/watcher/tests/decision_engine/cluster/test_nova_cdmc.py +++ b/watcher/tests/decision_engine/cluster/test_nova_cdmc.py @@ -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]