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
This commit is contained in:
Marek Marczykowski-Górecki 2018-01-17 16:21:11 +01:00
parent 3d4f626515
commit 7211c7daff
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -271,6 +271,16 @@ class Pool(object):
l.split('=', 1) for l in pool_info_data.splitlines()) l.split('=', 1) for l in pool_info_data.splitlines())
return self._config 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 @property
def driver(self): def driver(self):
''' Storage pool driver ''' ''' Storage pool driver '''