From 4cd8a2f46e076143b78a3033b3b1ebbbe399a2fb Mon Sep 17 00:00:00 2001 From: Matt Riedemann Date: Tue, 14 May 2019 17:40:13 -0400 Subject: [PATCH] Remove dead code from NovaClusterDataModelCollector The _add_virtual_layer and _add_virtual_servers methods have not been used since Ic4659d1f18af181203439a8bf1b38805ff34c309 in Stein so this change removes them. Change-Id: I8c05f29c3c03aa5897cb182bb492948771c42881 --- .../decision_engine/model/collector/nova.py | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/watcher/decision_engine/model/collector/nova.py b/watcher/decision_engine/model/collector/nova.py index ced94c894..94447f64d 100644 --- a/watcher/decision_engine/model/collector/nova.py +++ b/watcher/decision_engine/model/collector/nova.py @@ -15,7 +15,6 @@ from oslo_log import log -from watcher.common import exception from watcher.common import nova_helper from watcher.decision_engine.model.collector import base from watcher.decision_engine.model import element @@ -315,38 +314,6 @@ class ModelBuilder(object): # node_attributes) return compute_node - def _add_virtual_layer(self): - """Add the virtual layer to the graph. - - This layer is the virtual components of the infrastructure, - such as vms. - """ - self._add_virtual_servers() - # self._add_virtual_network() - # self._add_virtual_storage() - - def _add_virtual_servers(self): - all_instances = self.nova_helper.get_instance_list() - for inst in all_instances: - # Add Node - instance = self._build_instance_node(inst) - self.model.add_instance(instance) - # Get the cnode_name uuid. - cnode_uuid = getattr(inst, "OS-EXT-SRV-ATTR:host") - if cnode_uuid is None: - # The instance is not attached to any Compute node - continue - try: - # Nova compute node - # cnode = self.nova_helper.get_compute_node_by_hostname( - # cnode_uuid) - compute_node = self.model.get_node_by_uuid( - cnode_uuid) - # Connect the instance to its compute node - self.model.map_instance(instance, compute_node) - except exception.ComputeNodeNotFound: - continue - def add_instance_node(self, node): # node.servers is a list of server objects # New in nova version 2.53