cnt = [dst_node, iallocator].count(None)
if cnt != 1:
- raise errors.OpPrereqError("One and only one of the -n and -i"
+ raise errors.OpPrereqError("One and only one of the -n and -I"
" options must be passed")
selected_fields = ["name", "sinst_list"]
commands = {
- 'add': (AddNode, [ArgUnknown(min=1, max=1)],
+ 'add': (AddNode, [ArgHost(min=1, max=1)],
[DEBUG_OPT,
cli_option("-s", "--secondary-ip", dest="secondary_ip",
help="Specify the secondary ip for the node",
],
"[-s ip] [--readd] [--no-ssh-key-check] <node_name>",
"Add a node to the cluster"),
- 'evacuate': (EvacuateNode, [ArgNode(min=1, max=1)],
+ 'evacuate': (EvacuateNode, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT,
cli_option("-n", "--new-secondary", dest="dst_node",
help="New secondary node", metavar="NODE",
- default=None),
+ default=None,
+ completion_suggest=OPT_COMPL_ONE_NODE),
cli_option("-I", "--iallocator", metavar="<NAME>",
help="Select new secondary for the instance"
" automatically using the"
" <NAME> iallocator plugin",
- default=None, type="string"),
+ default=None, type="string",
+ completion_suggest=OPT_COMPL_ONE_IALLOCATOR),
],
"[-f] {-I <iallocator> | -n <dst>} <node>",
"Relocate the secondary instances from a node"
" to other nodes (only for instances with drbd disk template)"),
- 'failover': (FailoverNode, [ArgNode(min=1, max=1)],
+ 'failover': (FailoverNode, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT,
cli_option("--ignore-consistency", dest="ignore_consistency",
action="store_true", default=False,
"[-f] <node>",
"Stops the primary instances on a node and start them on their"
" secondary node (only for instances with drbd disk template)"),
- 'migrate': (MigrateNode, [ArgNode(min=1, max=1)],
+ 'migrate': (MigrateNode, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT,
cli_option("--non-live", dest="live",
default=True, action="store_false",
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
- 'info': (ShowNodeConfig, [ArgNode()], [DEBUG_OPT],
+ 'info': (ShowNodeConfig, ARGS_MANY_NODES, [DEBUG_OPT],
"[<node_name>...]", "Show information about the node(s)"),
- 'list': (ListNodes, [ArgNode()],
+ 'list': (ListNodes, ARGS_MANY_NODES,
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT, SYNC_OPT],
"[nodes...]",
"Lists the nodes in the cluster. The available fields"
" are (see the man page for details): %s"
" The default field list is (in order): %s." %
(", ".join(_LIST_HEADERS), ", ".join(_LIST_DEF_FIELDS))),
- 'modify': (SetNodeParams, [ArgNode(min=1, max=1)],
+ 'modify': (SetNodeParams, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT,
SUBMIT_OPT,
cli_option("-C", "--master-candidate", dest="master_candidate",
choices=('yes', 'no'), default=None,
help="Set the drained flag on the node"),
],
- "<node>", "Alters the parameters of a node"),
- 'powercycle': (PowercycleNode, [ArgNode(min=1, max=1)],
+ "<node_name>", "Alters the parameters of a node"),
+ 'powercycle': (PowercycleNode, ARGS_ONE_NODE,
[DEBUG_OPT, FORCE_OPT, CONFIRM_OPT],
"<node_name>", "Tries to forcefully powercycle a node"),
- 'remove': (RemoveNode, [ArgNode(min=1, max=1)], [DEBUG_OPT],
+ 'remove': (RemoveNode, ARGS_ONE_NODE, [DEBUG_OPT],
"<node_name>", "Removes a node from the cluster"),
'volumes': (ListVolumes, [ArgNode()],
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT],
"[<node_name>...]", "List logical volumes on node(s)"),
- 'physical-volumes': (ListPhysicalVolumes, [ArgNode()],
+ 'physical-volumes': (ListPhysicalVolumes, ARGS_MANY_NODES,
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT,
FIELDS_OPT, _STORAGE_TYPE_OPT],
"[<node_name>...]",
[DEBUG_OPT],
"<node_name> <storage_type> <name>",
"Repairs a storage volume on a node"),
- 'list-tags': (ListTags, [ArgNode(min=1, max=1)], [DEBUG_OPT],
+ 'list-tags': (ListTags, ARGS_ONE_NODE, [DEBUG_OPT],
"<node_name>", "List the tags of the given node"),
'add-tags': (AddTags, [ArgNode(min=1, max=1), ArgUnknown()],
[DEBUG_OPT, TAG_SRC_OPT],