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

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 <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 9bdab621
......@@ -179,6 +179,7 @@ def RenameCluster(opts, args):
op = opcodes.OpRenameCluster(name=new_name)
result = SubmitOpCode(op, opts=opts, cl=cl)
if result:
ToStdout("Cluster renamed from '%s' to '%s'", cluster_name, result)
return 0
......@@ -639,6 +639,7 @@ def RenameInstance(opts, args):
result = SubmitOrSend(op, opts)
if result:
ToStdout("Instance '%s' renamed to '%s'", args[0], result)
return 0
......@@ -449,6 +449,7 @@ def PowercycleNode(opts, args):
op = opcodes.OpPowercycleNode(node_name=node, force=opts.force)
result = SubmitOpCode(op, opts=opts)
if result:
return 0
......@@ -254,7 +254,7 @@ def ModifyOS(opts, args):
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