From c4dfbd58551b3e9cb35b47ff1c7f04291fce98aa Mon Sep 17 00:00:00 2001 From: licanwei Date: Wed, 7 Dec 2016 15:43:28 +0800 Subject: [PATCH] Repair log parameter error Multi-parameters should form a dict type Change-Id: Ia883de6a0e34cebd28ba7fb0ecd105acb6cf2830 --- .../strategies/vm_workload_consolidation.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py b/watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py index ae3fa3d6a..d439cdee9 100644 --- a/watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py +++ b/watcher/decision_engine/strategy/strategies/vm_workload_consolidation.py @@ -110,9 +110,9 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy): return state.value else: LOG.error(_LE('Unexpexted resource state type, ' - 'state=%(state)s, state_type=%(st)s.'), - state=state, - st=type(state)) + 'state=%(state)s, state_type=%(st)s.') % dict( + state=state, + st=type(state))) raise exception.WatcherException def add_action_enable_compute_node(self, node): @@ -161,9 +161,9 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy): # migration mechanism to move non active VMs. LOG.error( _LE('Cannot live migrate: instance_uuid=%(instance_uuid)s, ' - 'state=%(instance_state)s.'), - instance_uuid=instance_uuid, - instance_state=instance_state_str) + 'state=%(instance_state)s.') % dict( + instance_uuid=instance_uuid, + instance_state=instance_state_str)) return migration_type = 'live' @@ -240,10 +240,8 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy): if not instance_ram_util or not instance_disk_util: LOG.error( - _LE('No values returned by %(resource_id)s ' - 'for memory.usage or disk.root.size'), - resource_id=instance_uuid - ) + _LE('No values returned by %s for memory.usage ' + 'or disk.root.size'), instance_uuid) raise exception.NoDataFound self.ceilometer_instance_data_cache[instance_uuid] = dict(