From d79edb93d6e4b1a4e8991178b88c5d81b2ecb615 Mon Sep 17 00:00:00 2001
From: licanwei
Date: Tue, 7 Aug 2018 23:42:43 -0700
Subject: [PATCH] Fix TypeError in LOG.debug
Change-Id: I4a4050081d0a22cc66fdb311ef676d0ba802bb72
Closes-Bug: #1785962
---
.../strategy/strategies/zone_migration.py | 36 +++++++++----------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/watcher/decision_engine/strategy/strategies/zone_migration.py b/watcher/decision_engine/strategy/strategies/zone_migration.py
index b17ee7317..cbd917860 100644
--- a/watcher/decision_engine/strategy/strategies/zone_migration.py
+++ b/watcher/decision_engine/strategy/strategies/zone_migration.py
@@ -309,10 +309,10 @@ class ZoneMigration(base.ZoneMigrationBaseStrategy):
else:
self.instances_migration(targets, action_counter)
- LOG.debug("action total: %s, pools: %s, nodes %s ", (
+ LOG.debug("action total: %s, pools: %s, nodes %s ",
action_counter.total_count,
action_counter.per_pool_count,
- action_counter.per_node_count))
+ action_counter.per_node_count)
def post_execute(self):
"""Post-execution phase
@@ -416,7 +416,7 @@ class ZoneMigration(base.ZoneMigrationBaseStrategy):
src_type = volume.volume_type
dst_pool, dst_type = self.get_dst_pool_and_type(pool, src_type)
LOG.debug(src_type)
- LOG.debug("%s %s", (dst_pool, dst_type))
+ LOG.debug("%s %s", dst_pool, dst_type)
if self.is_available(volume):
if src_type == dst_type:
@@ -640,8 +640,8 @@ class ActionCounter(object):
if not self.is_total_max() and not self.is_pool_max(pool):
self.per_pool_count[pool] += 1
self.total_count += 1
- LOG.debug("total: %s, per_pool: %s", (
- self.total_count, self.per_pool_count))
+ LOG.debug("total: %s, per_pool: %s",
+ self.total_count, self.per_pool_count)
return True
return False
@@ -657,8 +657,8 @@ class ActionCounter(object):
if not self.is_total_max() and not self.is_node_max(node):
self.per_node_count[node] += 1
self.total_count += 1
- LOG.debug("total: %s, per_node: %s", (
- self.total_count, self.per_node_count))
+ LOG.debug("total: %s, per_node: %s",
+ self.total_count, self.per_node_count)
return True
return False
@@ -677,7 +677,7 @@ class ActionCounter(object):
if pool not in self.per_pool_count:
self.per_pool_count[pool] = 0
LOG.debug("the number of parallel per pool %s is %s ",
- (pool, self.per_pool_count[pool]))
+ pool, self.per_pool_count[pool])
LOG.debug("per pool limit is %s", self.per_pool_limit)
return self.per_pool_count[pool] >= self.per_pool_limit
@@ -721,7 +721,7 @@ class BaseFilter(object):
for k, v in six.iteritems(targets):
if not self.is_allowed(k):
continue
- LOG.debug("filter:%s with the key: %s", (cond, k))
+ LOG.debug("filter:%s with the key: %s", cond, k)
targets[k] = self.exec_filter(v, cond)
LOG.debug(targets)
@@ -775,7 +775,7 @@ class ProjectSortFilter(SortMovingToFrontFilter):
"""
project_id = self.get_project_id(item)
- LOG.debug("project_id: %s, sort_key: %s", (project_id, sort_key))
+ LOG.debug("project_id: %s, sort_key: %s", project_id, sort_key)
return project_id == sort_key
def get_project_id(self, item):
@@ -809,7 +809,7 @@ class ComputeHostSortFilter(SortMovingToFrontFilter):
"""
host = self.get_host(item)
- LOG.debug("host: %s, sort_key: %s", (host, sort_key))
+ LOG.debug("host: %s, sort_key: %s", host, sort_key)
return host == sort_key
def get_host(self, item):
@@ -837,7 +837,7 @@ class StorageHostSortFilter(SortMovingToFrontFilter):
"""
host = self.get_host(item)
- LOG.debug("host: %s, sort_key: %s", (host, sort_key))
+ LOG.debug("host: %s, sort_key: %s", host, sort_key)
return host == sort_key
def get_host(self, item):
@@ -909,9 +909,9 @@ class ComputeSpecSortFilter(BaseFilter):
:returns: memory size of item
"""
- LOG.debug("item: %s, flavors: %s", (item, flavors))
+ LOG.debug("item: %s, flavors: %s", item, flavors)
for flavor in flavors:
- LOG.debug("item.flavor: %s, flavor: %s", (item.flavor, flavor))
+ LOG.debug("item.flavor: %s, flavor: %s", item.flavor, flavor)
if item.flavor.get('id') == flavor.id:
LOG.debug("flavor.ram: %s", flavor.ram)
return flavor.ram
@@ -924,9 +924,9 @@ class ComputeSpecSortFilter(BaseFilter):
:returns: vcpu number of item
"""
- LOG.debug("item: %s, flavors: %s", (item, flavors))
+ LOG.debug("item: %s, flavors: %s", item, flavors)
for flavor in flavors:
- LOG.debug("item.flavor: %s, flavor: %s", (item.flavor, flavor))
+ LOG.debug("item.flavor: %s, flavor: %s", item.flavor, flavor)
if item.flavor.get('id') == flavor.id:
LOG.debug("flavor.vcpus: %s", flavor.vcpus)
return flavor.vcpus
@@ -939,9 +939,9 @@ class ComputeSpecSortFilter(BaseFilter):
:returns: disk size of item
"""
- LOG.debug("item: %s, flavors: %s", (item, flavors))
+ LOG.debug("item: %s, flavors: %s", item, flavors)
for flavor in flavors:
- LOG.debug("item.flavor: %s, flavor: %s", (item.flavor, flavor))
+ LOG.debug("item.flavor: %s, flavor: %s", item.flavor, flavor)
if item.flavor.get('id') == flavor.id:
LOG.debug("flavor.disk: %s", flavor.disk)
return flavor.disk