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

Add boot id to “gnt-node list”.

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