summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-07-17 12:26:23 +0300
committerLars Wirzenius <liw@liw.fi>2021-07-17 12:26:23 +0300
commit832015e23b3260bec824343d4855801c7af5b642 (patch)
tree5b65ee9f3ac8fbd383519acea4cdd5bedc049816
parent2685cde08d19e666cf670883997cf949a8c8a191 (diff)
downloadvmdb2-832015e23b3260bec824343d4855801c7af5b642.tar.gz
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
-rw-r--r--vmdb/plugins/mkpart_plugin.py8
1 files 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)