diff --git a/lib/cli.py b/lib/cli.py index e3e67b418a43668216598f828d17cec2b0b00b2d..ccf3090f0cd44453a4ab17c29de85163d9da8987 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 d6191d981b5b786196c922ae0585f1383f736b29..5e74e85d098d63fdcf28cb740189d3f15698de37 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],