[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [PATCH] Fix some remaining errors and require higher version of pycryptsetup



Martin Sivak wrote:
Hi,

Did you mean replacing the elif with the following code (with OR expression) and deleting else clause? It is doable, this was just more readable.

Right, with the or.  Mistake in my version.  But you got the idea.


elif not key_file or not os.path.isfile(key_file):
      raise ValueError("luks_format requires either a passphrase or a...")


Looks good.

M.

----- "David Cantrell" <dcantrell redhat com> wrote:

Comments below.

Martin Sivak wrote:
---
 anaconda.spec                |    2 +-
 storage/devicelibs/crypto.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/anaconda.spec b/anaconda.spec
index 8fc41a9..c581e90 100644
--- a/anaconda.spec
+++ b/anaconda.spec
@@ -40,7 +40,7 @@ BuildRoot:
%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %define createrepover 0.4.7
 %define yumutilsver 1.1.11-3
 %define iscsiver 6.2.0.870-3
-%define pythoncryptsetupver 0.0.4
+%define pythoncryptsetupver 0.0.6
BuildRequires: audit-libs-devel
 BuildRequires: booty
diff --git a/storage/devicelibs/crypto.py
b/storage/devicelibs/crypto.py
index e16bbe4..be919ff 100644
--- a/storage/devicelibs/crypto.py
+++ b/storage/devicelibs/crypto.py
@@ -46,7 +46,7 @@ def luks_uuid(device):
 def luks_status(name):
     """True means active, False means inactive (or
non-existent)"""
     cs = CryptSetup(yesDialog = askyes, logFunc = dolog)
-    return (cs.luksStatus(device)!=None)
+    return cs.luksStatus(name)!=0
def luks_format(device,
                 passphrase=None, key_file=None,
@@ -58,7 +58,7 @@ def luks_format(device,
         key_file = cs.prepare_passphrase_file(passphrase)
         key_file_unlink = True
     elif key_file and os.path.isfile(key_file):
-        argv.append(key_file)
+        pass
     else:
         raise ValueError("luks_format requires either a passphrase
or a key file")
What about this at the end:

elif not key_file and not os.path.isfile(key_file):
     raise ValueError("luks_format requires either a passphrase or a
key file")

And eliminating the else clause?

--
David Cantrell <dcantrell redhat com>
Red Hat / Honolulu, HI

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

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


--
David Cantrell <dcantrell redhat com>
Red Hat / Honolulu, HI


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]