diff --git a/cloudcontrol/node/hypervisor/lib.py b/cloudcontrol/node/hypervisor/lib.py index d9244b8c3eff6b31338b35cb92f7501de40b3b92..30a9a2fad0b11d62484e5c9611be5d05dc00ca9e 100644 --- a/cloudcontrol/node/hypervisor/lib.py +++ b/cloudcontrol/node/hypervisor/lib.py @@ -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()