Commit 6c4837c7 authored by Antoine Millet's avatar Antoine Millet

Do not fail to calculate sto tags if storage is not updated

parent 6bbe4988
......@@ -326,13 +326,15 @@ class StorageIndex(object):
Tag('sto%s_size' % s.name, partial(lambda x: x.capacity, s), 5, 5),
Tag('sto%s_free' % s.name, partial(lambda x: x.available, s), 5, 5),
Tag('sto%s_used' % s.name,
partial(lambda x: x.capacity - x.available, s), 5, 5),
partial(lambda x: x.capacity - x.available
if x.available is not None and x.capacity is not None else None, s), 5, 5),
Tag('sto%s_type' % s.name, partial(lambda x: x.type, s), 5, 5),
Tag('sto%s_vol' % s.name,
partial(lambda x: ' '.join(x.volumes) if x.volumes and not x.is_shared else None, s),
5, 5),
Tag('sto%s_ratio' % s.name,
partial(lambda x: '%0.2f' % (1 - float(x.available) / x.capacity), s), 5, 5),
partial(lambda x: '%0.2f' % (1 - float(x.available) / x.capacity)
if x.available is not None and x.capacity is not None else None, s), 5, 5),
))
self.update_path_index()
......
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