Fix NoMetricValuesForInstance error
This patch set allows in case of NoMetricValuesForInstance exception to continue the flow of Workload Stabilization strategy instead of interrupting. Closes-Bug: #1640096 Change-Id: I2de22bb97defb9c34e409102d06846275793b80d
This commit is contained in:
@@ -27,7 +27,7 @@ from oslo_config import cfg
|
||||
from oslo_log import log
|
||||
import oslo_utils
|
||||
|
||||
from watcher._i18n import _LI, _
|
||||
from watcher._i18n import _LI, _LW, _
|
||||
from watcher.common import exception
|
||||
from watcher.decision_engine.cluster.history import ceilometer as \
|
||||
ceilometer_cluster_history
|
||||
@@ -200,8 +200,12 @@ class WorkloadStabilization(base.WorkloadStabilizationBaseStrategy):
|
||||
aggregate='min'
|
||||
)
|
||||
if avg_meter is None:
|
||||
raise exception.NoMetricValuesForInstance(
|
||||
resource_id=instance_uuid, metric_name=meter)
|
||||
LOG.warning(
|
||||
_LW("No values returned by %(resource_id)s "
|
||||
"for %(metric_name)s") % dict(
|
||||
resource_id=instance_uuid,
|
||||
metric_name=meter))
|
||||
avg_meter = 0
|
||||
if meter == 'cpu_util':
|
||||
avg_meter /= float(100)
|
||||
instance_load[meter] = avg_meter
|
||||
|
||||
Reference in New Issue
Block a user