diff --git a/lib/cli.py b/lib/cli.py index 0ff5b435ec20a70de445f56b7c358d628655e121..949903f18cef54f959bdf8dc3d3ec74d0a68e23c 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -50,6 +50,7 @@ __all__ = [ "DISK_TEMPLATE_OPT", "FIELDS_OPT", "FILESTORE_DIR_OPT", + "FILESTORE_DRIVER_OPT", "FORCE_OPT", "NOHDR_OPT", "NONICS_OPT", @@ -493,6 +494,11 @@ FILESTORE_DIR_OPT = cli_option("--file-storage-dir", dest="file_storage_dir", " file storage dir to store file-based disks", default=None, metavar="<DIR>") +FILESTORE_DRIVER_OPT = cli_option("--file-driver", dest="file_driver", + help="Driver to use for image files", + default="loop", metavar="<DRIVER>", + choices=list(constants.FILE_DRIVER)) + def _ParseArgs(argv, commands, aliases): """Parser for the command line arguments. diff --git a/scripts/gnt-backup b/scripts/gnt-backup index 2f030e5e86640171027d1ebc96f6dd10e216303a..d1591329b29b275151ce7f111b3770cb5e7e88c7 100755 --- a/scripts/gnt-backup +++ b/scripts/gnt-backup @@ -246,9 +246,7 @@ import_opts = [ " <NAME> iallocator plugin", default=None, type="string", completion_suggest=OPT_COMPL_ONE_IALLOCATOR), FILESTORE_DIR_OPT, - cli_option("--file-driver", dest="file_driver", help="Driver to use" - " for image files", default="loop", metavar="<DRIVER>", - choices=list(constants.FILE_DRIVER)), + FILESTORE_DRIVER_OPT, cli_option("-H", "--hypervisor", dest="hypervisor", help="Hypervisor and hypervisor options, in the format" " hypervisor:option=value,option=value,...", default=None, diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 2598a7aa0c16d8ebfccb7513fc291fe7088f5455..321bf207e68f059d95a02e397c5d90a4cfcf3d51 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -1397,9 +1397,7 @@ add_opts = [ action="store_false", help="Don't check that the instance's IP" " is alive (only valid with --no-start)"), FILESTORE_DIR_OPT, - cli_option("--file-driver", dest="file_driver", help="Driver to use" - " for image files", default="loop", metavar="<DRIVER>", - choices=list(constants.FILE_DRIVER)), + FILESTORE_DRIVER_OPT, cli_option("-I", "--iallocator", metavar="<NAME>", help="Select nodes for the instance automatically using the" " <NAME> iallocator plugin", default=None, type="string",