diff --git a/lib/cli.py b/lib/cli.py index f93d72cc22f8baa8c5d3af263dc7cd845477382b..4f2dfef561111ea6c65c6834cba1ff757ad4563f 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -96,6 +96,7 @@ __all__ = [ "OS_OPT", "OS_SIZE_OPT", "READD_OPT", + "REBOOT_TYPE_OPT", "SECONDARY_IP_OPT", "SELECT_OS_OPT", "SEP_OPT", @@ -791,6 +792,12 @@ NONPLUS1_OPT = cli_option("--no-nplus1-mem", dest="skip_nplusone_mem", help="Skip N+1 memory redundancy tests", action="store_true", default=False) +REBOOT_TYPE_OPT = cli_option("-t", "--type", dest="reboot_type", + help="Type of reboot: soft/hard/full", + default=constants.INSTANCE_REBOOT_HARD, + metavar="<REBOOT>", + choices=list(constants.REBOOT_TYPES)) + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 8f59ffe18ba34cae31bac98da4527de7dd177bec..8b1ca4e8b0a3ff62b5a7328e79009d461e45e3b1 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1466,12 +1466,7 @@ commands = { ], "<instance>", "Starts an instance"), 'reboot': (RebootInstance, [ArgInstance(min=1)], - [DEBUG_OPT, m_force_multi, - cli_option("-t", "--type", dest="reboot_type", - help="Type of reboot: soft/hard/full", - default=constants.INSTANCE_REBOOT_HARD, - metavar="<REBOOT>", - choices=list(constants.REBOOT_TYPES)), + [DEBUG_OPT, m_force_multi, REBOOT_TYPE_OPT, cli_option("--ignore-secondaries", dest="ignore_secondaries", default=False, action="store_true", help="Ignore errors from secondaries"),