Commit 8e47b5da authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Two more PEP8 fixes



cmdlib: Avoid wrapping using backslash

gnt_group: Avoid ** magic using keyword arguments (the “pep8” tool
doesn't like the inline comment in this case and will complain about
spaces around the “**” operator)
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 674711de
......@@ -130,17 +130,13 @@ def SetGroupParams(opts, args):
@return: the desired exit code
"""
all_changes = {
"ndparams": opts.ndparams,
"alloc_policy": opts.alloc_policy,
}
if all_changes.values().count(None) == len(all_changes):
if opts.ndparams is None and opts.alloc_policy is None:
ToStderr("Please give at least one of the parameters.")
return 1
op = opcodes.OpGroupSetParams(group_name=args[0], # pylint: disable-msg=W0142
**all_changes)
op = opcodes.OpGroupSetParams(group_name=args[0],
ndparams=opts.ndparams,
alloc_policy=opts.alloc_policy)
result = SubmitOrSend(op, opts)
if result:
......
......@@ -9831,6 +9831,8 @@ class TLReplaceDisks(Tasklet):
"""
steps_total = 6
pnode = self.instance.primary_node
# Step: check device activation
self.lu.LogStep(1, steps_total, "Check device existence")
self._CheckDisksExistence([self.instance.primary_node])
......@@ -9905,10 +9907,8 @@ class TLReplaceDisks(Tasklet):
" soon as possible"))
self.lu.LogInfo("Detaching primary drbds from the network (=> standalone)")
result = self.rpc.call_drbd_disconnect_net([self.instance.primary_node],
self.node_secondary_ip,
self.instance.disks)\
[self.instance.primary_node]
result = self.rpc.call_drbd_disconnect_net([pnode], self.node_secondary_ip,
self.instance.disks)[pnode]
msg = result.fail_msg
if msg:
......
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