FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 03-06-2009, 10:21 AM
Martin Sivak
 
Default Do not pass None values into nonmandatory arguments, you are screwing the default values..

---
storage/devicelibs/crypto.py | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)

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:
--
1.5.4.3

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 01:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org