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

Add vm_capable to gnt-node modify


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 077114cd
......@@ -54,6 +54,7 @@ __all__ = [
"BACKEND_OPT",
"BLK_OS_OPT",
"CAPAB_MASTER_OPT",
"CAPAB_VM_OPT",
"CLEANUP_OPT",
"CLUSTER_DOMAIN_SECRET_OPT",
"CONFIRM_OPT",
......@@ -875,6 +876,10 @@ CAPAB_MASTER_OPT = cli_option("--master-capable", dest="master_capable",
type="bool", default=None, metavar=_YORNO,
help="Set the master_capable flag on the node")
CAPAB_VM_OPT = cli_option("--vm-capable", dest="vm_capable",
type="bool", default=None, metavar=_YORNO,
help="Set the vm_capable flag on the node")
ALLOCATABLE_OPT = cli_option("--allocatable", dest="allocatable",
type="bool", default=None, metavar=_YORNO,
help="Set the allocatable flag on a volume")
......
......@@ -649,7 +649,9 @@ def SetNodeParams(opts, args):
@return: the desired exit code
"""
if [opts.master_candidate, opts.drained, opts.offline].count(None) == 3:
all_changes = [opts.master_candidate, opts.drained, opts.offline,
opts.master_capable, opts.vm_capable]
if all_changes.count(None) == len(all_changes):
ToStderr("Please give at least one of the parameters.")
return 1
......@@ -658,6 +660,7 @@ def SetNodeParams(opts, args):
offline=opts.offline,
drained=opts.drained,
master_capable=opts.master_capable,
vm_capable=opts.vm_capable,
force=opts.force,
auto_promote=opts.auto_promote)
......@@ -709,7 +712,8 @@ commands = {
(utils.CommaJoin(_LIST_HEADERS), utils.CommaJoin(_LIST_DEF_FIELDS))),
'modify': (
SetNodeParams, ARGS_ONE_NODE,
[FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT, CAPAB_MASTER_OPT,
[FORCE_OPT, SUBMIT_OPT, MC_OPT, DRAINED_OPT, OFFLINE_OPT,
CAPAB_MASTER_OPT, CAPAB_VM_OPT,
AUTO_PROMOTE_OPT, DRY_RUN_OPT, PRIORITY_OPT],
"<node_name>", "Alters the parameters of a node"),
'powercycle': (
......
......@@ -627,6 +627,7 @@
<arg>--drained=<option>yes|no</option></arg>
<arg>--offline=<option>yes|no</option></arg>
<arg>--master-capable=<option>yes|no</option></arg>
<arg>--vm-capable=<option>yes|no</option></arg>
<arg>--auto-promote</arg>
<arg choice="req"><replaceable>node</replaceable></arg>
</cmdsynopsis>
......
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