summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-01-01 19:27:39 +0200
committerLars Wirzenius <liw@liw.fi>2022-01-01 19:27:39 +0200
commitfbb09fc99098af587974569074497f6e21a51889 (patch)
tree8935819019da6805db51c20df1095b0bcfe076c9
parenta5d1632d7fb4d141acb067644154f1136100a06b (diff)
downloadvmdb2-fbb09fc99098af587974569074497f6e21a51889.tar.gz
fix crypttab?
Sponsored-by: author
-rw-r--r--vmdb/plugins/fstab_plugin.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/vmdb/plugins/fstab_plugin.py b/vmdb/plugins/fstab_plugin.py
index 04c2312..9caeea3 100644
--- a/vmdb/plugins/fstab_plugin.py
+++ b/vmdb/plugins/fstab_plugin.py
@@ -62,9 +62,12 @@ class FstabStepRunner(vmdb.StepRunnerInterface):
for entry in filesystems:
fstab.write(line.format(**entry))
- crypttab_path = os.path.join(chroot, "etc/crypttab")
- line = "{name} UUID={uuid} none luks,discard\n"
- with open(crypttab_path, "w") as crypttab:
- for entry in filesystems:
- if "uuid" in entry and "name" in entry:
+ entries = [e for e in filesystems if "uuid" in e and "name" in e]
+ vmdb.progress(f"filesystems: {filesystems}")
+ vmdb.progress(f"crypttab entries: {entries}")
+ if entries:
+ crypttab_path = os.path.join(chroot, "etc/crypttab")
+ line = "{name} UUID={uuid} none luks,discard\n"
+ with open(crypttab_path, "w") as crypttab:
+ for entry in entries:
crypttab.write(line.format(**entry))