X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=nodecommon.py;fp=nodecommon.py;h=cbbc2c43cb8f8e63f8815fb99888f2dd7a113af0;hb=32e6f3bdf4fe68b057cf070b756418333ae707d6;hp=624ee2ca39a32da4f982603745619c3982b7b052;hpb=90538dc0769a98b872edd703c3a16006c2aaa3c8;p=monitor.git diff --git a/nodecommon.py b/nodecommon.py index 624ee2c..cbbc2c4 100644 --- a/nodecommon.py +++ b/nodecommon.py @@ -109,6 +109,16 @@ def diff_time(timestamp, abstime=True): t_str = "%s mnths ago" % int(t) return t_str +def getvalue(fb, path): + indexes = path.split("/") + values = fb + for index in indexes: + if index in values: + values = values[index] + else: + return None + return values + def nodegroup_display(node, fb, conf=None): if node['hostname'] in fb['nodes']: node['current'] = get_current_state(fb['nodes'][node['hostname']]['values'])