Fix ThinVolume.size initialization from string

The size config parameter might be a string coming from XML.
The Volume base class handles the conversion to integer already.

Fixes QubesOS/qubes-issues#5219.
This commit is contained in:
Pawel Marczewski 2020-01-23 10:39:47 +01:00
parent 686f66bb85
commit 49f2c1b78d
No known key found for this signature in database
GPG Key ID: DE42EE9B14F96465

View File

@ -314,9 +314,9 @@ class ThinVolume(qubes.storage.Volume):
''' # pylint: disable=too-few-public-methods
def __init__(self, volume_group, size=0, **kwargs):
def __init__(self, volume_group, **kwargs):
self.volume_group = volume_group
super(ThinVolume, self).__init__(size=size, **kwargs)
super(ThinVolume, self).__init__(**kwargs)
self.log = logging.getLogger('qubes.storage.lvm.%s' % str(self.pool))
if self.snap_on_start or self.save_on_stop:
@ -324,7 +324,6 @@ class ThinVolume(qubes.storage.Volume):
if self.save_on_stop:
self._vid_import = self.vid + '-import'
self._size = size
self._lock = asyncio.Lock()
@property