Commit 64c1fddc authored by Nigel Kukard's avatar Nigel Kukard
Browse files

lvm: Cleaned up manual snapshot size specification

parent f8fdfd66
Pipeline #6748 passed with stage
in 54 seconds
......@@ -58,12 +58,16 @@ class LVMBackupArchive(BackupArchiveDevices):
# Also save any config we have for them, like the snapshot size'Adding LVM volumes to archive "{archive_name}":')
for lvm_volume_info in lvm_volume_list:
# Split off the config, in this case snapshot size at the end
(lvm_volume, snapshot_size) = lvm_volume_info.split(":")
# Split off the config
(lvm_volume, *lvm_volume_config) = lvm_volume_info.split(":")
# Work out the snapshot size
snapshot_size = None
if lvm_volume_config:
snapshot_size = lvm_volume_config[0]
# Check if we have a snapshot size, if we do, save it
if snapshot_size:
self._lvm_snapshot_size[lvm_volume] = snapshot_size" - {lvm_volume} (snapshot size = {snapshot_size}")" - {lvm_volume} (snapshot size = {snapshot_size})")
else:" - {lvm_volume}")
# Add volume to list
......@@ -126,7 +130,7 @@ class LVMBackupArchive(BackupArchiveDevices):
# Add snapshot to our list
self._snapshots[lvm_volume] = snapshot_device" - Snapshotting '{lvm_volume}' as '{snapshot_lv}' with {snapshot_size}MB of space")" - Snapshotting '{lvm_volume}' as '{snapshot_lv}' with {snapshot_size} of space")
self.notifiers.debug(f"Running: {snapshot_args}")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment