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

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

parent 6bbe4988
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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()