Commit 3ef10550 authored by Michael Hanselmann's avatar Michael Hanselmann

Add boot id to “gnt-node list”.

Reviewed-by: iustinp
parent b9ea6acb
......@@ -170,6 +170,12 @@ def GetNodeInfo(vgname):
if hyp_info is not None:
outputarray.update(hyp_info)
f = open("/proc/sys/kernel/random/boot_id", 'r')
try:
outputarray["bootid"] = f.read(128).rstrip("\n")
finally:
f.close()
return outputarray
......
......@@ -1198,7 +1198,8 @@ class LUQueryNodes(NoHooksLU):
"""
self.dynamic_fields = frozenset(["dtotal", "dfree",
"mtotal", "mnode", "mfree"])
"mtotal", "mnode", "mfree",
"bootid"])
_CheckOutputFields(static=["name", "pinst_cnt", "sinst_cnt",
"pinst_list", "sinst_list",
......@@ -1229,6 +1230,7 @@ class LUQueryNodes(NoHooksLU):
"mfree": utils.TryConvert(int, nodeinfo['memory_free']),
"dtotal": utils.TryConvert(int, nodeinfo['vg_size']),
"dfree": utils.TryConvert(int, nodeinfo['vg_free']),
"bootid": nodeinfo['bootid'],
}
else:
live_data[name] = {}
......
......@@ -58,7 +58,8 @@ def ListNodes(opts, args):
"pinst_list": "PriInstances", "sinst_list": "SecInstances",
"pip": "PrimaryIP", "sip": "SecondaryIP",
"dtotal": "DTotal", "dfree": "DFree",
"mtotal": "MTotal", "mnode": "MNode", "mfree": "MFree"}
"mtotal": "MTotal", "mnode": "MNode", "mfree": "MFree",
"bootid": "BootID"}
else:
headers = None
......
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