Fix _build_instance_node for building Compute CDM

As of Nova API microversion 2.47, response of GET /servers/detail has flavor
which contains a subset of the actual flavor information used to create the
server instance, represented as a nested dictionary.

Since current watcher nova default api version is 2.53(Pike), This patch
follows the API response change.

Change-Id: Ia575950f0702afa1d093f03ca8ddedd3c410b7de
Closes-Bug: #1722462
This commit is contained in:
Hidekazu Nakamura
2017-10-10 17:21:05 +09:00
parent fa7749ac8f
commit 7d33bf8813
3 changed files with 5 additions and 12 deletions

View File

@@ -19,7 +19,6 @@
import mock
from watcher.common import nova_helper
from watcher.common import utils
from watcher.decision_engine.model.collector import nova
from watcher.tests import base
from watcher.tests import conf_fixture
@@ -62,9 +61,6 @@ class TestNovaClusterDataModelCollector(base.TestCase):
# m_nova_helper.get_instances_by_node.return_value = [fake_instance]
m_nova_helper.get_instance_list.return_value = [fake_instance]
m_nova_helper.get_flavor.return_value = utils.Struct(**{
'ram': 333, 'disk': 222, 'vcpus': 4})
m_config = mock.Mock()
m_osc = mock.Mock()