diff --git a/lib/cli.py b/lib/cli.py index 5047d5d6d51f7e966198504ce3d7c432965c5317..28c486f2637b240d44024e4f8e85b401efac62fa 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -58,6 +58,7 @@ __all__ = [ "HVOPTS_OPT", "HYPERVISOR_OPT", "IALLOCATOR_OPT", + "IGNORE_CONSIST_OPT", "FORCE_OPT", "NET_OPT", "NOHDR_OPT", @@ -560,6 +561,12 @@ OS_SIZE_OPT = cli_option("-s", "--os-size", dest="sd_size", " given disk size, in MiB unless a suffix is used", default=None, type="unit", metavar="<size>") +IGNORE_CONSIST_OPT = cli_option("--ignore-consistency", + dest="ignore_consistency", + action="store_true", default=False, + help="Ignore the consistency of the disks on" + " the secondary") + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 9c7dd84d6438742f002bd70ce5f6e710aa302546..7a293da807e1e2b53f3e627ba463e9bc3100588f 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1402,13 +1402,7 @@ commands = { "[--show-cmd] <instance>", "Opens a console on the specified instance"), 'failover': (FailoverInstance, ARGS_ONE_INSTANCE, - [DEBUG_OPT, FORCE_OPT, - cli_option("--ignore-consistency", dest="ignore_consistency", - action="store_true", default=False, - help="Ignore the consistency of the disks on" - " the secondary"), - SUBMIT_OPT, - ], + [DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT, SUBMIT_OPT], "[-f] <instance>", "Stops the instance and starts it on the backup node, using" " the remote mirror (only for instances of type drbd)"), diff --git a/scripts/gnt-node b/scripts/gnt-node index d68e1b8d0be5f466d2e887a4c63c9d19e5f63a70..15dd03a192b25bb0261e803552e09e0526df00ce 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -647,12 +647,7 @@ commands = { "Relocate the secondary instances from a node" " to other nodes (only for instances with drbd disk template)"), 'failover': (FailoverNode, ARGS_ONE_NODE, - [DEBUG_OPT, FORCE_OPT, - cli_option("--ignore-consistency", dest="ignore_consistency", - action="store_true", default=False, - help="Ignore the consistency of the disks on" - " the secondary"), - ], + [DEBUG_OPT, FORCE_OPT, IGNORE_CONSIST_OPT], "[-f] <node>", "Stops the primary instances on a node and start them on their" " secondary node (only for instances with drbd disk template)"),