Commit 48418fea authored by Iustin Pop's avatar Iustin Pop

Fix a few commands behaviour with dry-run

These commands use or display the result from the LU, so in case of
dry-run, they will crash or display just 'None'. At least checking that
the result is 'true' (in the boolean sense) will make them work better.

As for gnt-os modify, it didn't pass the 'opts' parameter properly to
SubmitOpCode, so the dry-run option was silently ignored.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 9bdab621
......@@ -179,7 +179,8 @@ def RenameCluster(opts, args):
op = opcodes.OpRenameCluster(name=new_name)
result = SubmitOpCode(op, opts=opts, cl=cl)
ToStdout("Cluster renamed from '%s' to '%s'", cluster_name, result)
if result:
ToStdout("Cluster renamed from '%s' to '%s'", cluster_name, result)
return 0
......
......@@ -639,7 +639,8 @@ def RenameInstance(opts, args):
name_check=opts.name_check)
result = SubmitOrSend(op, opts)
ToStdout("Instance '%s' renamed to '%s'", args[0], result)
if result:
ToStdout("Instance '%s' renamed to '%s'", args[0], result)
return 0
......
......@@ -449,7 +449,8 @@ def PowercycleNode(opts, args):
op = opcodes.OpPowercycleNode(node_name=node, force=opts.force)
result = SubmitOpCode(op, opts=opts)
ToStderr(result)
if result:
ToStderr(result)
return 0
......
......@@ -254,7 +254,7 @@ def ModifyOS(opts, args):
candidate_pool_size=None,
os_hvp=os_hvp,
osparams=osp)
SubmitOpCode(op)
SubmitOpCode(op, opts=opts)
return 0
......
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