Revision 83ec7961
b/autotools/build-bash-completion | ||
---|---|---|
321 | 321 |
elif isinstance(arg, cli.ArgCommand): |
322 | 322 |
choices = "" |
323 | 323 |
compgenargs.append("-c") |
324 |
elif isinstance(arg, cli.ArgHost): |
|
325 |
choices = "" |
|
326 |
compgenargs.append("-A hostname") |
|
324 | 327 |
else: |
325 | 328 |
raise Exception("Unknown argument type %r" % arg) |
326 | 329 |
|
b/lib/cli.py | ||
---|---|---|
53 | 53 |
"ToStderr", "ToStdout", "UsesRPC", |
54 | 54 |
"GetOnlineNodes", "JobExecutor", "SYNC_OPT", "CONFIRM_OPT", |
55 | 55 |
"ArgJobId", "ArgSuggest", "ArgUnknown", "ArgFile", "ArgCommand", |
56 |
"ArgInstance", "ArgNode", "ArgChoice", |
|
56 |
"ArgInstance", "ArgNode", "ArgChoice", "ArgHost",
|
|
57 | 57 |
"ARGS_NONE", "ARGS_ONE_INSTANCE", "ARGS_ONE_NODE", |
58 | 58 |
"ARGS_MANY_INSTANCES", "ARGS_MANY_NODES", |
59 | 59 |
] |
... | ... | |
131 | 131 |
""" |
132 | 132 |
|
133 | 133 |
|
134 |
class ArgHost(_Argument): |
|
135 |
"""Host argument. |
|
136 |
|
|
137 |
""" |
|
138 |
|
|
139 |
|
|
134 | 140 |
ARGS_NONE = [] |
135 | 141 |
ARGS_MANY_INSTANCES = [ArgInstance()] |
136 | 142 |
ARGS_MANY_NODES = [ArgNode()] |
b/scripts/gnt-cluster | ||
---|---|---|
541 | 541 |
metavar="<node>", default=[]) |
542 | 542 |
|
543 | 543 |
commands = { |
544 |
'init': (InitCluster, [ArgUnknown(min=1, max=1)],
|
|
544 |
'init': (InitCluster, [ArgHost(min=1, max=1)],
|
|
545 | 545 |
[DEBUG_OPT, |
546 | 546 |
cli_option("-s", "--secondary-ip", dest="secondary_ip", |
547 | 547 |
help="Specify the secondary ip for this node;" |
... | ... | |
608 | 608 |
action="store_true"), |
609 | 609 |
], |
610 | 610 |
"", "Destroy cluster"), |
611 |
'rename': (RenameCluster, [ArgUnknown(min=1, max=1)],
|
|
611 |
'rename': (RenameCluster, [ArgHost(min=1, max=1)],
|
|
612 | 612 |
[DEBUG_OPT, FORCE_OPT], |
613 | 613 |
"<new_name>", |
614 | 614 |
"Renames the cluster"), |
b/scripts/gnt-instance | ||
---|---|---|
1418 | 1418 |
] |
1419 | 1419 |
|
1420 | 1420 |
commands = { |
1421 |
'add': (AddInstance, [ArgUnknown(min=1, max=1)], add_opts,
|
|
1421 |
'add': (AddInstance, [ArgHost(min=1, max=1)], add_opts,
|
|
1422 | 1422 |
"[...] -t disk-type -n node[:secondary-node] -o os-type <name>", |
1423 | 1423 |
"Creates and adds a new instance to the cluster"), |
1424 | 1424 |
'batch-create': (BatchCreate, [ArgFile(min=1, max=1)], |
... | ... | |
1517 | 1517 |
], |
1518 | 1518 |
"[-f] <instance>", "Shuts down the instance and removes it"), |
1519 | 1519 |
'rename': (RenameInstance, |
1520 |
[ArgInstance(min=1, max=1), ArgUnknown(min=1, max=1)],
|
|
1520 |
[ArgInstance(min=1, max=1), ArgHost(min=1, max=1)],
|
|
1521 | 1521 |
[DEBUG_OPT, |
1522 | 1522 |
cli_option("--no-ip-check", dest="ignore_ip", |
1523 | 1523 |
help="Do not check that the IP of the new name" |
b/scripts/gnt-node | ||
---|---|---|
622 | 622 |
|
623 | 623 |
|
624 | 624 |
commands = { |
625 |
'add': (AddNode, [ArgUnknown(min=1, max=1)],
|
|
625 |
'add': (AddNode, [ArgHost(min=1, max=1)],
|
|
626 | 626 |
[DEBUG_OPT, |
627 | 627 |
cli_option("-s", "--secondary-ip", dest="secondary_ip", |
628 | 628 |
help="Specify the secondary ip for the node", |
Also available in: Unified diff