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

Add group, group.uuid fields in node list

This is needed to at least see the current group configuration.
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarMichael Hanselmann <>
parent e90739d6
......@@ -77,6 +77,7 @@ _LIST_HEADERS = {
"role": "Role",
"ctime": "CTime", "mtime": "MTime", "uuid": "UUID",
"master_capable": "MasterCapable", "vm_capable": "VMCapable",
"group": "Group", "group.uuid": "GroupUUID",
......@@ -3361,8 +3361,9 @@ class LUQueryNodes(NoHooksLU):
"pinst_cnt", "sinst_cnt",
"pinst_list", "sinst_list",
"pip", "sip", "tags",
"role"] + _SIMPLE_FIELDS
"master", "role",
"group.uuid", "group",
def CheckArguments(self):
......@@ -3404,6 +3405,11 @@ class LUQueryNodes(NoHooksLU):
nodenames = utils.NiceSort(nodenames)
nodelist = [all_info[name] for name in nodenames]
if "group" in self.op.output_fields:
groups = self.cfg.GetAllNodeGroupsInfo()
groups = {}
# begin data gathering
if self.do_node_query:
......@@ -3485,6 +3491,14 @@ class LUQueryNodes(NoHooksLU):
val = "O"
val = "R"
elif field == "group.uuid":
val =
elif field == "group":
ng = groups.get(, None)
if ng is None:
val = "<unknown>"
val =
raise errors.ParameterError(field)
......@@ -545,6 +545,20 @@
<para>whether the node can host instances</para>
<para>the name of the node's group, if known (the query
is done without locking, so data consistency is not
<para>the UUID of the node's group</para>
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