From 7211c7daff4538be4da87899fea1f0ce17d1c67b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 17 Jan 2018 16:21:11 +0100 Subject: [PATCH] storage: add size and usage properties It's already available in config dict, but lets provide uniform API. And also it's a bit weird to look for usage data in configuration... QubesOS/qubes-issues#3240 --- qubesadmin/storage.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qubesadmin/storage.py b/qubesadmin/storage.py index 16ed4ed..40877dc 100644 --- a/qubesadmin/storage.py +++ b/qubesadmin/storage.py @@ -271,6 +271,16 @@ class Pool(object): l.split('=', 1) for l in pool_info_data.splitlines()) return self._config + @property + def size(self): + ''' Storage pool size, in bytes''' + return self.config['size'] + + @property + def usage(self): + ''' Space used in the pool, in bytes ''' + return self.config['usage'] + @property def driver(self): ''' Storage pool driver '''