summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-02-16 15:59:47 +0200
committerLars Wirzenius <liw@liw.fi>2022-02-16 15:59:47 +0200
commit132e1f6ffb696085c395cda40c5a079101c92f9a (patch)
tree1412410e4d6ff67e1b30e540d63ce56416327893
parent9db7236ef6f3b374076615c019cb22559e06a669 (diff)
downloadvmdb2-132e1f6ffb696085c395cda40c5a079101c92f9a.tar.gz
fix: how luksFormat is called
Sponsored-by: author
-rw-r--r--vmdb/plugins/luks_plugin.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/vmdb/plugins/luks_plugin.py b/vmdb/plugins/luks_plugin.py
index 2ed132b..b736bea 100644
--- a/vmdb/plugins/luks_plugin.py
+++ b/vmdb/plugins/luks_plugin.py
@@ -67,15 +67,23 @@ class CryptsetupStepRunner(vmdb.StepRunnerInterface):
)
assert 0
- vmdb.runcmd(["cryptsetup", "-q", "luksFormat", dev, key_file])
vmdb.runcmd(
[
"cryptsetup",
- "open",
+ "-q",
+ "luksFormat",
"--type",
"luks2",
- "--key-file",
"--allow-discards",
+ dev,
+ key_file,
+ ]
+ )
+ vmdb.runcmd(
+ [
+ "cryptsetup",
+ "open",
+ "--key-file",
key_file,
dev,
crypt_name,