From 1f587d3d3c57bc246653d5485348405b3f1948db Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 17 Sep 2009 14:30:41 +0200 Subject: [PATCH] =?UTF-8?q?Move=20the=20=E2=80=9C--yes-do-it=E2=80=9D=20op?= =?UTF-8?q?tion=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 | 3 +++ scripts/gnt-cluster | 6 +----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/cli.py b/lib/cli.py index e3e67b418..ccf3090f0 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -103,6 +103,7 @@ __all__ = [ "USEUNITS_OPT", "VERBOSE_OPT", "VG_NAME_OPT", + "YES_DOIT_OPT", # Generic functions for CLI programs "GenericMain", "GetClient", @@ -743,6 +744,8 @@ VG_NAME_OPT = cli_option("-g", "--vg-name", dest="vg_name", " name (cluster-wide) for disk allocation [xenvg]", metavar="VG", default=None) +YES_DOIT_OPT = cli_option("--yes-do-it", dest="yes_do_it", + help="Destroy cluster", action="store_true") def _ParseArgs(argv, commands, aliases): diff --git a/scripts/gnt-cluster b/scripts/gnt-cluster index d6191d981..5e74e85d0 100755 --- a/scripts/gnt-cluster +++ b/scripts/gnt-cluster @@ -627,11 +627,7 @@ commands = { "[opts...] <cluster_name>", "Initialises a new cluster configuration"), 'destroy': (DestroyCluster, ARGS_NONE, - [DEBUG_OPT, - cli_option("--yes-do-it", dest="yes_do_it", - help="Destroy cluster", - action="store_true"), - ], + [DEBUG_OPT, YES_DOIT_OPT], "", "Destroy cluster"), 'rename': (RenameCluster, [ArgHost(min=1, max=1)], [DEBUG_OPT, FORCE_OPT], -- GitLab