Martin Sivak wrote:
---
storage/devicelibs/crypto.py | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
Looks good.
diff --git a/storage/devicelibs/crypto.py b/storage/devicelibs/crypto.py
index be919ff..28da47c 100644
--- a/storage/devicelibs/crypto.py
+++ b/storage/devicelibs/crypto.py
@@ -62,7 +62,15 @@ def luks_format(device,
else:
raise ValueError("luks_format requires either a passphrase or a key file")
- rc = cs.luksFormat(device = device, cipher = cipher, keysize = key_size, keyfile = key_file)
+ #None is not considered as default value and pycryptsetup doesn't accept it
+ #so we need to filter out all Nones
+ kwargs = {}
+ kwargs["device"] = device
+ if cipher: kwargs["cipher"] = cipher
+ if key_file: kwargs["keyfile"] = key_file
+ if key_size: kwargs["keysize"] = key_size
+
+ rc = cs.luksFormat(**kwargs)
if key_file_unlink: os.unlink(key_file)
if rc:
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list