Check disk io stats availability

This commit is contained in:
Kload 2013-12-05 14:35:42 +00:00
parent dbb452e29f
commit f6b0c4d553

View file

@ -78,6 +78,11 @@ def monitor_disk(units=None, mountpoint=None, human_readable=False):
else: else:
d['mnt_point'] = devices[dname] d['mnt_point'] = devices[dname]
result[dname] = d result[dname] = d
for dname in devices.keys():
if len(units) > 1 and u not in result[dname]:
result[dname][u] = 'not-available'
elif len(result[dname]) == 0:
result[dname] = 'not-available'
elif u == 'filesystem': elif u == 'filesystem':
for d in json.loads(glances.getFs()): for d in json.loads(glances.getFs()):
dmount = d['mnt_point'] dmount = d['mnt_point']