summaryrefslogtreecommitdiffstats
path: root/cryptodev.py
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2008-02-01 12:28:22 -0600
committerDavid Lehman <dlehman@redhat.com>2008-02-05 10:41:23 -0600
commitcb2fef4829797c37a5784cd3f033734eb19eb128 (patch)
tree8b95f9b3bbe16496ad070ca550f8f30db16f2faf /cryptodev.py
parent2aa8679975c838c2217803e152ce317a9cff9a57 (diff)
downloadanaconda-cb2fef4829797c37a5784cd3f033734eb19eb128.tar.gz
anaconda-cb2fef4829797c37a5784cd3f033734eb19eb128.tar.xz
anaconda-cb2fef4829797c37a5784cd3f033734eb19eb128.zip
Allow creation of LUKSDevice with no passphrase.
The hack in getScheme for autopart causes a traceback if a LUKSdevice is created without a passphrase, which is something that makes sense to do when discovering existing devices. So we just use the "scheme" data member internally as a workaround. Also, make sure all return values from openDevice are numeric.
Diffstat (limited to 'cryptodev.py')
-rw-r--r--cryptodev.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cryptodev.py b/cryptodev.py
index 39f3fd9a8..2cd14d784 100644
--- a/cryptodev.py
+++ b/cryptodev.py
@@ -64,7 +64,7 @@ class LUKSDevice:
def setDevice(self, device):
self._device = device
if device is not None:
- name = "%s-%s" % (self.getScheme().lower(),
+ name = "%s-%s" % (self.scheme.lower(),
os.path.basename(device))
self.setName(name)
@@ -149,7 +149,7 @@ class LUKSDevice:
def openDevice(self):
if not self.getStatus():
# already mapped
- return
+ return 0
if not self.passphrase:
raise RuntimeError, "Cannot create mapping without a passphrase."