From 832015e23b3260bec824343d4855801c7af5b642 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 17 Jul 2021 12:26:23 +0300 Subject: fix: disable realpath'ing the output device in mkpart The os.path.realpath resolves symlinks, and for some reason I do not currently understand this breaks using vmdb2 with --image pointing at an LVM2 logical volume. Sponsored-by: author --- vmdb/plugins/mkpart_plugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vmdb/plugins/mkpart_plugin.py b/vmdb/plugins/mkpart_plugin.py index 4f97492..cc842ff 100644 --- a/vmdb/plugins/mkpart_plugin.py +++ b/vmdb/plugins/mkpart_plugin.py @@ -48,9 +48,13 @@ class MkpartStepRunner(vmdb.StepRunnerInterface): tag = values["tag"] or values["part-tag"] or None fs_type = values["fs-type"] - device = os.path.realpath(device) + # Enabling this breaks installation to an LVM2 logical volume. + # device = os.path.realpath(device) + orig = self.list_partitions(device) - vmdb.runcmd(["parted", "-s", device, "--", "mkpart", part_type, fs_type, start, end]) + vmdb.runcmd( + ["parted", "-s", device, "--", "mkpart", part_type, fs_type, start, end] + ) new = self.list_partitions(device) diff = self.diff_partitions(orig, new) -- cgit v1.2.1