Commit e3876ccb authored by Iustin Pop's avatar Iustin Pop
Browse files

Unify the “--disk” (identkeyval) option


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 7d3a9fab
......@@ -49,6 +49,7 @@ __all__ = [
"DEBUG_OPT",
"DEBUG_SIMERR_OPT",
"DISK_TEMPLATE_OPT",
"DISK_OPT",
"FIELDS_OPT",
"FILESTORE_DIR_OPT",
"FILESTORE_DRIVER_OPT",
......@@ -544,6 +545,9 @@ NET_OPT = cli_option("--net",
help="NIC parameters", default=[],
dest="nics", action="append", type="identkeyval")
DISK_OPT = cli_option("--disk", help="Disk parameters", default=[],
dest="disks", action="append", type="identkeyval")
def _ParseArgs(argv, commands, aliases):
"""Parser for the command line arguments.
......
......@@ -217,10 +217,7 @@ import_opts = [
completion_suggest=OPT_COMPL_INST_ADD_NODES),
BACKEND_OPT,
DISK_TEMPLATE_OPT,
cli_option("--disk", help="Disk information",
default=[], dest="disks",
action="append",
type="identkeyval"),
DISK_OPT,
cli_option("-s", "--os-size", dest="sd_size", help="Disk size for a"
" single-disk configuration, when not using the --disk option,"
" in MiB unless a suffix is used",
......
......@@ -1374,10 +1374,7 @@ add_opts = [
" single-disk configuration, when not using the --disk option,"
" in MiB unless a suffix is used",
default=None, type="unit", metavar="<size>"),
cli_option("--disk", help="Disk information",
default=[], dest="disks",
action="append",
type="identkeyval"),
DISK_OPT,
NET_OPT,
NONICS_OPT,
NWSYNC_OPT,
......@@ -1525,16 +1522,8 @@ commands = {
"[-s|-p|-n NODE|-I NAME] <instance>",
"Replaces all disks for the instance"),
'modify': (SetInstanceParams, ARGS_ONE_INSTANCE,
[DEBUG_OPT, FORCE_OPT,
HVOPTS_OPT,
BACKEND_OPT,
cli_option("--disk", help="Disk changes",
default=[], dest="disks",
action="append",
type="identkeyval"),
NET_OPT,
SUBMIT_OPT,
],
[BACKEND_OPT, DEBUG_OPT, DISK_OPT, FORCE_OPT, HVOPTS_OPT,
NET_OPT, SUBMIT_OPT],
"<instance>", "Alters the parameters of an instance"),
'shutdown': (ShutdownInstance, [ArgInstance(min=1)],
[DEBUG_OPT, m_node_opt, m_pri_node_opt, m_sec_node_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