Commit 9ddb5e45 authored by Iustin Pop's avatar Iustin Pop
Browse files

node list: add the offline field

Reviewed-by: ultrotter
parent fc0fe88c
......@@ -1661,6 +1661,7 @@ class LUQueryNodes(NoHooksLU):
"serial_no",
"master_candidate",
"master",
"offline",
)
def ExpandNames(self):
......@@ -1780,6 +1781,8 @@ class LUQueryNodes(NoHooksLU):
val = node.master_candidate
elif field == "master":
val = node.name == master_node
elif field == "offline":
val = node.offline
elif self._FIELDS_DYNAMIC.Matches(field):
val = live_data[node.name].get(field, None)
else:
......
......@@ -54,6 +54,7 @@ _LIST_HEADERS = {
"serial_no": "SerialNo",
"master_candidate": "MasterC",
"master": "IsMaster",
"offline": "Offline",
}
......@@ -138,7 +139,7 @@ def ListNodes(opts, args):
val = row[idx]
if field in list_type_fields:
val = ",".join(val)
elif field in ('master', 'master_candidate'):
elif field in ('master', 'master_candidate', 'offline'):
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