Merge "Fix _build_instance_node for building Compute CDM"
This commit is contained in:
@@ -70,9 +70,6 @@ class NovaHelper(object):
|
||||
def get_service(self, service_id):
|
||||
return self.nova.services.find(id=service_id)
|
||||
|
||||
def get_flavor(self, flavor_id):
|
||||
return self.nova.flavors.get(flavor_id)
|
||||
|
||||
def get_aggregate_list(self):
|
||||
return self.nova.aggregates.list()
|
||||
|
||||
|
||||
@@ -227,14 +227,14 @@ class ModelBuilder(object):
|
||||
:param instance: Nova VM object.
|
||||
:return: A instance node for the graph.
|
||||
"""
|
||||
flavor = self.nova_helper.get_flavor(instance.flavor["id"])
|
||||
flavor = instance.flavor
|
||||
instance_attributes = {
|
||||
"uuid": instance.id,
|
||||
"human_id": instance.human_id,
|
||||
"memory": flavor.ram,
|
||||
"disk": flavor.disk,
|
||||
"disk_capacity": flavor.disk,
|
||||
"vcpus": flavor.vcpus,
|
||||
"memory": flavor["ram"],
|
||||
"disk": flavor["disk"],
|
||||
"disk_capacity": flavor["disk"],
|
||||
"vcpus": flavor["vcpus"],
|
||||
"state": getattr(instance, "OS-EXT-STS:vm_state"),
|
||||
"metadata": instance.metadata}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user