diff --git a/lib/cli.py b/lib/cli.py index 26a4b4d405a38fab5d6a909c8942af708b387cfe..bbe5158b37dbcf04b1f42d06f7b3ce6db57ce2e6 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -50,6 +50,7 @@ __all__ = [ "FIELDS_OPT", "FORCE_OPT", "NOHDR_OPT", + "NWSYNC_OPT", "SEP_OPT", "SUBMIT_OPT", "SYNC_OPT", @@ -470,6 +471,10 @@ DEBUG_SIMERR_OPT = cli_option("--debug-simulate-errors", default=False, help="Debugging option that makes the operation" " treat most runtime checks as failed") +NWSYNC_OPT = cli_option("--no-wait-for-sync", dest="wait_for_sync", + default=True, action="store_false", + help="Don't wait for sync (DANGEROUS!)") + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 12a667dfb6212cbebc8534f11da2ee0fcb29c4f1..a45256f742db538a87ade483fd13ecb9d2a2d789 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -236,8 +236,7 @@ import_opts = [ type="identkeyval"), cli_option("--no-nics", default=False, action="store_true", help="Do not create any network cards for the instance"), - cli_option("--no-wait-for-sync", dest="wait_for_sync", default=True, - action="store_false", help="Don't wait for sync (DANGEROUS!)"), + NWSYNC_OPT, cli_option("--src-node", dest="src_node", help="Source node", metavar="<node>", completion_suggest=OPT_COMPL_ONE_NODE), diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 498061447c21a4d90879b0219b1778fee5604752..256b39a4c11af50123d247ea687d9e2d9c0b2060 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1393,8 +1393,7 @@ add_opts = [ type="identkeyval"), cli_option("--no-nics", default=False, action="store_true", help="Do not create any network cards for the instance"), - cli_option("--no-wait-for-sync", dest="wait_for_sync", default=True, - action="store_false", help="Don't wait for sync (DANGEROUS!)"), + NWSYNC_OPT, cli_option("--no-start", dest="start", default=True, action="store_false", help="Don't start the instance after" " creation"), @@ -1642,12 +1641,7 @@ commands = { 'grow-disk': (GrowDisk, [ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1), ArgUnknown(min=1, max=1)], - [DEBUG_OPT, SUBMIT_OPT, - cli_option("--no-wait-for-sync", - dest="wait_for_sync", default=True, - action="store_false", - help="Don't wait for sync (DANGEROUS!)"), - ], + [DEBUG_OPT, SUBMIT_OPT, NWSYNC_OPT], "<instance> <disk> <size>", "Grow an instance's disk"), 'list-tags': (ListTags, ARGS_ONE_INSTANCE, [DEBUG_OPT], "<instance_name>", "List the tags of the given instance"),