X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=nodecommon.py;h=334bc3e008dd690f5076cff5a6e34c24f97f4931;hp=a3117d8097fe2fcf39c946c5415f32303348ed2d;hb=6f2351e4b44590221425fa9b4bfa77c92db49b6a;hpb=19414270cf2c8429daab02fdebbd8081d9ba0db0 diff --git a/nodecommon.py b/nodecommon.py index a3117d8..334bc3e 100644 --- a/nodecommon.py +++ b/nodecommon.py @@ -112,6 +112,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'])