Commit 9b945588 authored by Stephen Shirley's avatar Stephen Shirley Committed by Guido Trotter
Browse files

Fix pylint warnings

- 1 80-char line infraction
- 4 changes in how arguments are passed to logging functions
- 3 pylint disable-msg's because cluster-merge needs to access ganeti
  config internals
Signed-off-by: default avatarStephen Shirley <>
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarGuido Trotter <>
parent f0b1bafe
......@@ -52,7 +52,8 @@ PAUSE_PERIOD_OPT = cli.cli_option("-p", "--watcher-pause-period", default=1800,
help=("Amount of time in seconds watcher"
" should be suspended from running"))
GROUPS_OPT = cli.cli_option("--groups", default=None, metavar="STRATEGY",
choices=(_GROUPS_MERGE, _GROUPS_RENAME), dest="groups",
help=("How to handle groups that have the"
" same name (One of: %s/%s)" %
......@@ -314,7 +315,7 @@ class Merger(object):
ConfigWriter.AddNodeGroup takes care of making sure there are no conflicts.
# pylint: disable-msg=R0201"Node group conflict strategy: %s" % self.groups)"Node group conflict strategy: %s", self.groups)
my_grps = my_config.GetAllNodeGroupsInfo().values()
other_grps = other_config.GetAllNodeGroupsInfo().values()
......@@ -328,7 +329,7 @@ class Merger(object):
if conflicts:
conflict_names = utils.CommaJoin([ for g in conflicts])"Node groups in both local and remote cluster: %s" %"Node groups in both local and remote cluster: %s",
# User hasn't specified how to handle conflicts
......@@ -343,18 +344,25 @@ class Merger(object):
for grp in conflicts:
new_name = "%s-%s" % (, other_config.GetClusterName())"Renaming remote node group from %s to %s"
" to resolve conflict" % (, new_name))
" to resolve conflict",, new_name) = new_name
# User wants to merge conflicting groups
elif self.groups == 'merge':
for other_grp in conflicts:"Merging local and remote '%s' groups" %"Merging local and remote '%s' groups",
for node_name in other_grp.members[:]:
node = other_config.GetNodeInfo(node_name)
# Access to a protected member of a client class
# pylint: disable-msg=W0212
# Access to a protected member of a client class
# pylint: disable-msg=W0212
my_grp_uuid = my_config._UnlockedLookupNodeGroup(
# Access to a protected member of a client class
# pylint: disable-msg=W0212
my_config._UnlockedAddNodeToGroup(node, my_grp_uuid) = my_grp_uuid
# Remove from list of groups to add
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment