Revision 919852da lib/client/gnt_group.py
b/lib/client/gnt_group.py | ||
---|---|---|
50 | 50 |
SubmitOpCode(op, opts=opts) |
51 | 51 |
|
52 | 52 |
|
53 |
def AssignNodes(opts, args): |
|
54 |
"""Assign nodes to a group. |
|
55 |
|
|
56 |
@param opts: the command line options selected by the user |
|
57 |
@type args: list |
|
58 |
@param args: args[0]: group to assign nodes to; args[1:]: nodes to assign |
|
59 |
@rtype: int |
|
60 |
@return: the desired exit code |
|
61 |
|
|
62 |
""" |
|
63 |
group_name = args[0] |
|
64 |
node_names = args[1:] |
|
65 |
|
|
66 |
op = opcodes.OpAssignGroupNodes(group_name=group_name, nodes=node_names, |
|
67 |
force=opts.force) |
|
68 |
SubmitOpCode(op, opts=opts) |
|
69 |
|
|
70 |
|
|
53 | 71 |
def ListGroups(opts, args): |
54 | 72 |
"""List node groups and their properties. |
55 | 73 |
|
... | ... | |
148 | 166 |
"add": ( |
149 | 167 |
AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE_PARAMS_OPT], |
150 | 168 |
"<group_name>", "Add a new node group to the cluster"), |
169 |
"assign-nodes": ( |
|
170 |
AssignNodes, ARGS_ONE_GROUP + ARGS_MANY_NODES, [DRY_RUN_OPT, FORCE_OPT], |
|
171 |
"<group_name> <node>...", "Assign nodes to a group"), |
|
151 | 172 |
"list": ( |
152 | 173 |
ListGroups, ARGS_MANY_GROUPS, |
153 | 174 |
[NOHDR_OPT, SEP_OPT, FIELDS_OPT], |
Also available in: Unified diff