qubes/storage: allow passing just volume name to storage.resize

It makes much more sense to call:

    vm.storage.resize('private', 10000000000)

instead of:

    vm.storage.resize(vm.volumes['private'], 10000000000)
This commit is contained in:
Marek Marczykowski-Górecki 2016-08-17 22:42:15 +02:00
parent d8286b6dab
commit 6e383c703d
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -306,6 +306,8 @@ class Storage(object):
def resize(self, volume, size): def resize(self, volume, size):
''' Resizes volume a read-writable volume ''' ''' Resizes volume a read-writable volume '''
if isinstance(volume, basestring):
volume = self.vm.volumes[volume]
self.get_pool(volume).resize(volume, size) self.get_pool(volume).resize(volume, size)
def create(self): def create(self):