diff options
Diffstat (limited to 'vmdb/plugins/fstab_plugin.py')
-rw-r--r-- | vmdb/plugins/fstab_plugin.py | 13 |
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)) |