Commit 91e0748c authored by Iustin Pop's avatar Iustin Pop
Browse files

Unify the “--no-ip-check” option


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 073271f6
......@@ -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.
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment