summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Small <tim@seoss.co.uk>2020-05-06 11:56:59 +0100
committerLars Wirzenius <liw@liw.fi>2020-05-25 11:41:31 +0300
commitf6522d9deff1e02ac34a094e66f24d2c35d3092c (patch)
treecb25e266f1d31512b74c07e1293954398ae1cc39
parent92367938f6bf91598b453f259f322f5c5334045f (diff)
downloadvmdb2-f6522d9deff1e02ac34a094e66f24d2c35d3092c.tar.gz
Use canonical device name (e.g. for /dev/disk/by-path/ etc.).
Previously, symbolic links to device files were not recognised, and so could not be used with the --output switch (unless an additional kpartx step was also used).
-rw-r--r--vmdb/plugins/mkpart_plugin.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/vmdb/plugins/mkpart_plugin.py b/vmdb/plugins/mkpart_plugin.py
index bf33694..6b0a602 100644
--- a/vmdb/plugins/mkpart_plugin.py
+++ b/vmdb/plugins/mkpart_plugin.py
@@ -53,6 +53,7 @@ class MkpartStepRunner(vmdb.StepRunnerInterface):
tag = values['tag'] or values['part-tag'] or None
fs_type = values['fs-type']
+ device = os.path.realpath(device)
orig = self.list_partitions(device)
vmdb.runcmd(['parted', '-s', device, 'mkpart', part_type, fs_type, start, end])
new = self.list_partitions(device)