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

Export the capability flags in query, rapi, ialloc


Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 490acd18
......@@ -3197,7 +3197,8 @@ class LUQueryNodes(NoHooksLU):
REQ_BGL = False
_SIMPLE_FIELDS = ["name", "serial_no", "ctime", "mtime", "uuid",
"master_candidate", "offline", "drained"]
"master_candidate", "offline", "drained",
"master_capable", "vm_capable"]
_FIELDS_DYNAMIC = utils.FieldSet(
"dtotal", "dfree",
......@@ -10244,6 +10245,8 @@ class IAllocator(object):
"drained": ninfo.drained,
"master_candidate": ninfo.master_candidate,
"group": ninfo.group,
"master_capable": ninfo.master_capable,
"vm_capable": ninfo.vm_capable,
}
if not (ninfo.offline or ninfo.drained):
......
......@@ -69,6 +69,7 @@ N_FIELDS = ["name", "offline", "master_candidate", "drained",
"ctotal", "cnodes", "csockets",
"pip", "sip", "role",
"pinst_list", "sinst_list",
"master_capable", "vm_capable",
] + _COMMON_FIELDS
_NR_DRAINED = "drained"
......
......@@ -524,6 +524,18 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>master_capable</term>
<listitem>
<para>whether the node can become a master candidate</para>
</listitem>
</varlistentry>
<varlistentry>
<term>vm_capable</term>
<listitem>
<para>whether the node can host instances</para>
</listitem>
</varlistentry>
</variablelist>
</para>
......
......@@ -77,7 +77,8 @@ _LIST_HEADERS = {
"master": "IsMaster",
"offline": "Offline", "drained": "Drained",
"role": "Role",
"ctime": "CTime", "mtime": "MTime", "uuid": "UUID"
"ctime": "CTime", "mtime": "MTime", "uuid": "UUID",
"master_capable": "MasterCapable", "vm_capable": "VMCapable",
}
......@@ -251,7 +252,8 @@ def ListNodes(opts, args):
val = row[idx]
if field in list_type_fields:
val = ",".join(val)
elif field in ('master', 'master_candidate', 'offline', 'drained'):
elif field in ('master', 'master_candidate', 'offline', 'drained',
'master_capable', 'vm_capable'):
if val:
val = 'Y'
else:
......
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