mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
Remove hardcoded .vdi in QEMUVolume exceptions
This commit is contained in:
parent
ebd8f71fdb
commit
f4a00b7eb1
1 changed files with 6 additions and 4 deletions
|
@ -14,14 +14,16 @@ class QEMUVolume(LoopbackVolume):
|
||||||
from base.fs.partitionmaps.none import NoPartitions
|
from base.fs.partitionmaps.none import NoPartitions
|
||||||
if isinstance(self.partition_map, NoPartitions):
|
if isinstance(self.partition_map, NoPartitions):
|
||||||
if not self._module_loaded('nbd'):
|
if not self._module_loaded('nbd'):
|
||||||
raise VolumeError('The kernel module `nbd\' must be loaded '
|
msg = ('The kernel module `nbd\' must be loaded '
|
||||||
'(`modprobe nbd\') to attach .vdi images')
|
'(`modprobe nbd\') to attach .{extension} images'
|
||||||
|
.format(extension=self.extension))
|
||||||
|
raise VolumeError(msg)
|
||||||
else:
|
else:
|
||||||
num_partitions = len(self.partition_map.partitions)
|
num_partitions = len(self.partition_map.partitions)
|
||||||
if not self._module_loaded('nbd'):
|
if not self._module_loaded('nbd'):
|
||||||
msg = ('The kernel module `nbd\' must be loaded '
|
msg = ('The kernel module `nbd\' must be loaded '
|
||||||
'(`modprobe nbd max_part={num_partitions}\') to attach .vdi images'
|
'(`modprobe nbd max_part={num_partitions}\') to attach .{extension} images'
|
||||||
.format(num_partitions=num_partitions))
|
.format(num_partitions=num_partitions, extension=self.extension))
|
||||||
raise VolumeError(msg)
|
raise VolumeError(msg)
|
||||||
nbd_max_part = int(self._module_param('nbd', 'max_part'))
|
nbd_max_part = int(self._module_param('nbd', 'max_part'))
|
||||||
if nbd_max_part < num_partitions:
|
if nbd_max_part < num_partitions:
|
||||||
|
|
Loading…
Add table
Reference in a new issue