From 1205486180c92d66d610f3b55d573eeaff816196 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 17 Sep 2009 14:48:43 +0200 Subject: [PATCH] =?UTF-8?q?Move=20the=20=E2=80=9C--reboot-type=E2=80=9D=20?= =?UTF-8?q?option=20to=20cli.py?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: Michael Hanselmann <hansmi@google.com> --- lib/cli.py | 7 +++++++ scripts/gnt-instance | 7 +------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/cli.py b/lib/cli.py index f93d72cc2..4f2dfef56 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 8f59ffe18..8b1ca4e8b 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"), -- GitLab