Commit 4d98c565 authored by Guido Trotter's avatar Guido Trotter
Browse files

gnt-* use the correct opcode slot to build opcodes



gnt-* scripts were building wrong opcodes for commands which had the
shutdown_timeout slot (due to missing testing after renaming). Fixing.

Also change SHUTDOWN_TIMEOUT_OPT dest field name to "shutdown_timeout":
it was set to "timeout". It would still work that way, but possibly be
confusing.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent f940cf61
...@@ -821,8 +821,8 @@ TIMEOUT_OPT = cli_option("--timeout", dest="timeout", type="int", ...@@ -821,8 +821,8 @@ TIMEOUT_OPT = cli_option("--timeout", dest="timeout", type="int",
default=constants.DEFAULT_SHUTDOWN_TIMEOUT, default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
help="Maximum time to wait") help="Maximum time to wait")
SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout", dest="timeout", SHUTDOWN_TIMEOUT_OPT = cli_option("--shutdown-timeout",
type="int", dest="shutdown_timeout", type="int",
default=constants.DEFAULT_SHUTDOWN_TIMEOUT, default=constants.DEFAULT_SHUTDOWN_TIMEOUT,
help="Maximum time to wait for instance shutdown") help="Maximum time to wait for instance shutdown")
......
...@@ -73,7 +73,7 @@ def ExportInstance(opts, args): ...@@ -73,7 +73,7 @@ def ExportInstance(opts, args):
op = opcodes.OpExportInstance(instance_name=args[0], op = opcodes.OpExportInstance(instance_name=args[0],
target_node=opts.node, target_node=opts.node,
shutdown=opts.shutdown, shutdown=opts.shutdown,
timeout=opts.timeout) shutdown_timeout=opts.shutdown_timeout)
fin_resu, dlist = SubmitOpCode(op) fin_resu, dlist = SubmitOpCode(op)
if not isinstance(dlist, list): if not isinstance(dlist, list):
......
...@@ -564,7 +564,7 @@ def RemoveInstance(opts, args): ...@@ -564,7 +564,7 @@ def RemoveInstance(opts, args):
op = opcodes.OpRemoveInstance(instance_name=instance_name, op = opcodes.OpRemoveInstance(instance_name=instance_name,
ignore_failures=opts.ignore_failures, ignore_failures=opts.ignore_failures,
timeout=opts.timeout) shutdown_timeout=opts.shutdown_timeout)
SubmitOrSend(op, opts, cl=cl) SubmitOrSend(op, opts, cl=cl)
return 0 return 0
...@@ -715,7 +715,7 @@ def _RebootInstance(name, opts): ...@@ -715,7 +715,7 @@ def _RebootInstance(name, opts):
return opcodes.OpRebootInstance(instance_name=name, return opcodes.OpRebootInstance(instance_name=name,
reboot_type=opts.reboot_type, reboot_type=opts.reboot_type,
ignore_secondaries=opts.ignore_secondaries, ignore_secondaries=opts.ignore_secondaries,
timeout=opts.timeout) shutdown_timeout=opts.shutdown_timeout)
def _ShutdownInstance(name, opts): def _ShutdownInstance(name, opts):
...@@ -806,7 +806,7 @@ def FailoverInstance(opts, args): ...@@ -806,7 +806,7 @@ def FailoverInstance(opts, args):
op = opcodes.OpFailoverInstance(instance_name=instance_name, op = opcodes.OpFailoverInstance(instance_name=instance_name,
ignore_consistency=opts.ignore_consistency, ignore_consistency=opts.ignore_consistency,
timeout=opts.timeout) shutdown_timeout=opts.shutdown_timeout)
SubmitOrSend(op, opts, cl=cl) SubmitOrSend(op, opts, cl=cl)
return 0 return 0
...@@ -872,7 +872,7 @@ def MoveInstance(opts, args): ...@@ -872,7 +872,7 @@ def MoveInstance(opts, args):
op = opcodes.OpMoveInstance(instance_name=instance_name, op = opcodes.OpMoveInstance(instance_name=instance_name,
target_node=opts.node, target_node=opts.node,
timeout=opts.timeout) shutdown_timeout=opts.shutdown_timeout)
SubmitOrSend(op, opts, cl=cl) SubmitOrSend(op, opts, cl=cl)
return 0 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