---
lib/cli.py | 7 +++++++
scripts/gnt-backup | 4 +---
scripts/gnt-instance | 12 ++----------
3 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/lib/cli.py b/lib/cli.py
index 3f4d938..c81bf54 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -58,6 +58,7 @@ __all__ = [
"IALLOCATOR_OPT",
"FORCE_OPT",
"NOHDR_OPT",
+ "NOIPCHECK_OPT",
"NONICS_OPT",
"NWSYNC_OPT",
"OS_OPT",
@@ -533,6 +534,12 @@ HVLIST_OPT = cli_option("-H", "--hypervisor-parameters",
dest="hvparams",
" format hypervisor:option=value,option=value,...",
default=[], action="append", type="identkeyval")
+NOIPCHECK_OPT = cli_option("--no-ip-check", dest="ip_check", default=True,
+ action="store_false",
+ help="Don't check that the instance's IP"
+ " is alive")
+
+
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
diff --git a/scripts/gnt-backup b/scripts/gnt-backup
index ba52b39..a1bb6e6 100755
--- a/scripts/gnt-backup
+++ b/scripts/gnt-backup
@@ -236,9 +236,7 @@ import_opts = [
completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("--src-dir", dest="src_dir", help="Source directory",
metavar="<dir>"),
- cli_option("--no-ip-check", dest="ip_check", default=True,
- action="store_false", help="Don't check that the instance's IP"
- " is alive"),
+ NOIPCHECK_OPT,
IALLOCATOR_OPT,
FILESTORE_DIR_OPT,
FILESTORE_DRIVER_OPT,
diff --git a/scripts/gnt-instance b/scripts/gnt-instance
index 3a52ae9..d3c3895 100755
--- a/scripts/gnt-instance
+++ b/scripts/gnt-instance
@@ -1387,9 +1387,7 @@ add_opts = [
cli_option("--no-start", dest="start", default=True,
action="store_false", help="Don't start the instance after"
" creation"),
- cli_option("--no-ip-check", dest="ip_check", default=True,
- action="store_false", help="Don't check that the instance's IP"
- " is alive (only valid with --no-start)"),
+ NOIPCHECK_OPT,
FILESTORE_DIR_OPT,
FILESTORE_DRIVER_OPT,
IALLOCATOR_OPT,
@@ -1499,13 +1497,7 @@ commands = {
"[-f] <instance>", "Shuts down the instance and removes it"),
'rename': (RenameInstance,
[ArgInstance(min=1, max=1), ArgHost(min=1, max=1)],
- [DEBUG_OPT,
- cli_option("--no-ip-check", dest="ignore_ip",
- help="Do not check that the IP of the new name"
- " is alive",
- default=False, action="store_true"),
- SUBMIT_OPT,
- ],
+ [DEBUG_OPT, NOIPCHECK_OPT, SUBMIT_OPT],
"<instance> <new_name>", "Rename the instance"),
'replace-disks': (ReplaceDisks, ARGS_ONE_INSTANCE,
[DEBUG_OPT,
--
1.6.3.3