From f4a00b7eb1c88a053674f0a4913a07663fcc44f7 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Thu, 9 Jan 2014 17:23:02 +0100 Subject: [PATCH] Remove hardcoded .vdi in QEMUVolume exceptions --- common/fs/qemuvolume.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/common/fs/qemuvolume.py b/common/fs/qemuvolume.py index 5139d08..0d40599 100644 --- a/common/fs/qemuvolume.py +++ b/common/fs/qemuvolume.py @@ -14,14 +14,16 @@ class QEMUVolume(LoopbackVolume): from base.fs.partitionmaps.none import NoPartitions if isinstance(self.partition_map, NoPartitions): if not self._module_loaded('nbd'): - raise VolumeError('The kernel module `nbd\' must be loaded ' - '(`modprobe nbd\') to attach .vdi images') + msg = ('The kernel module `nbd\' must be loaded ' + '(`modprobe nbd\') to attach .{extension} images' + .format(extension=self.extension)) + raise VolumeError(msg) else: num_partitions = len(self.partition_map.partitions) if not self._module_loaded('nbd'): msg = ('The kernel module `nbd\' must be loaded ' - '(`modprobe nbd max_part={num_partitions}\') to attach .vdi images' - .format(num_partitions=num_partitions)) + '(`modprobe nbd max_part={num_partitions}\') to attach .{extension} images' + .format(num_partitions=num_partitions, extension=self.extension)) raise VolumeError(msg) nbd_max_part = int(self._module_param('nbd', 'max_part')) if nbd_max_part < num_partitions: