Merge "Typo in ClusteStateNotDefined"
This commit is contained in:
@@ -294,7 +294,7 @@ class MetricCollectorNotDefined(WatcherException):
|
||||
message = _("The metrics resource collector is not defined.'")
|
||||
|
||||
|
||||
class ClusteStateNotDefined(WatcherException):
|
||||
class ClusterStateNotDefined(WatcherException):
|
||||
message = _("the cluster state is not defined")
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#
|
||||
from oslo_log import log
|
||||
from watcher.common.exception import ClusterEmpty
|
||||
from watcher.common.exception import ClusteStateNotDefined
|
||||
from watcher.common.exception import ClusterStateNotDefined
|
||||
from watcher.decision_engine.actions.hypervisor_state import \
|
||||
ChangeHypervisorState
|
||||
from watcher.decision_engine.actions.migration import Migrate
|
||||
@@ -297,7 +297,7 @@ class BasicConsolidation(BaseStrategy):
|
||||
:return: score
|
||||
"""
|
||||
if model is None:
|
||||
raise ClusteStateNotDefined()
|
||||
raise ClusterStateNotDefined()
|
||||
|
||||
vm_cpu_utilization = self.ceilometer. \
|
||||
statistic_aggregation(resource_id=vm.uuid,
|
||||
@@ -321,7 +321,7 @@ class BasicConsolidation(BaseStrategy):
|
||||
|
||||
def print_utilization(self, model):
|
||||
if model is None:
|
||||
raise ClusteStateNotDefined()
|
||||
raise ClusterStateNotDefined()
|
||||
for node_id in model.get_all_hypervisors():
|
||||
LOG.debug("{0} utilization {1} % ".
|
||||
format(node_id,
|
||||
@@ -334,7 +334,7 @@ class BasicConsolidation(BaseStrategy):
|
||||
LOG.debug("initialize Sercon Consolidation")
|
||||
|
||||
if orign_model is None:
|
||||
raise ClusteStateNotDefined()
|
||||
raise ClusterStateNotDefined()
|
||||
|
||||
# todo(jed) clone model
|
||||
current_model = orign_model
|
||||
|
||||
@@ -127,7 +127,7 @@ class TestBasicConsolidation(base.BaseTestCase):
|
||||
|
||||
def test_exception_model(self):
|
||||
sercon = BasicConsolidation()
|
||||
self.assertRaises(exception.ClusteStateNotDefined, sercon.execute,
|
||||
self.assertRaises(exception.ClusterStateNotDefined, sercon.execute,
|
||||
None)
|
||||
|
||||
def test_exception_cluster_empty(self):
|
||||
@@ -143,12 +143,12 @@ class TestBasicConsolidation(base.BaseTestCase):
|
||||
sercon.ceilometer = MagicMock(
|
||||
statistic_aggregation=self.fake_metrics.mock_get_statistics)
|
||||
|
||||
self.assertRaises(exception.ClusteStateNotDefined,
|
||||
self.assertRaises(exception.ClusterStateNotDefined,
|
||||
sercon.calculate_score_vm, "VM_1", None)
|
||||
|
||||
def test_print_utilization_raise_cluster_state_not_found(self):
|
||||
sercon = BasicConsolidation()
|
||||
self.assertRaises(exception.ClusteStateNotDefined,
|
||||
self.assertRaises(exception.ClusterStateNotDefined,
|
||||
sercon.print_utilization, None)
|
||||
|
||||
def test_check_migration(self):
|
||||
|
||||
Reference in New Issue
Block a user