diff --git a/src/amcrest/storage.py b/src/amcrest/storage.py index 892a3a6..acb6fa1 100644 --- a/src/amcrest/storage.py +++ b/src/amcrest/storage.py @@ -13,7 +13,7 @@ import re from .exceptions import AmcrestError -from .utils import to_unit, percent, pretty +from .utils import to_unit, percent _USED = '.UsedBytes' _TOTAL = '.TotalBytes' @@ -25,6 +25,7 @@ def _express_as(value, unit): except (TypeError, ValueError): return 'unknown', unit + class Storage(object): @property @@ -82,4 +83,7 @@ def storage_all(self): used_percent = percent(used, total) except (TypeError, ValueError, ZeroDivisionError): used_percent = 'unknown' - return used_percent, _express_as(used, 'GB'), _express_as(total, 'GB') + return { + 'used_percent': used_percent, + 'used': _express_as(used, 'GB'), + 'total': _express_as(total, 'GB')}