summaryrefslogtreecommitdiffstats
path: root/storage/formats
diff options
context:
space:
mode:
authorDavid Lehman <dlehman@redhat.com>2009-10-12 12:55:17 -0500
committerDavid Lehman <dlehman@redhat.com>2009-10-12 13:42:19 -0500
commit7de0610fcfd6ce78af5f7eb90ed55ab44679fe23 (patch)
treec90b72ec2d2aa1dcac88d7ad30a9910327b97e89 /storage/formats
parenta5cb938be91cb1322d8ad32fb27c892eb90b93d7 (diff)
downloadanaconda-7de0610fcfd6ce78af5f7eb90ed55ab44679fe23.tar.gz
anaconda-7de0610fcfd6ce78af5f7eb90ed55ab44679fe23.tar.xz
anaconda-7de0610fcfd6ce78af5f7eb90ed55ab44679fe23.zip
Missing volume_key shouldn't break LUKS support completely. (#526899)
Live images don't contain volume_key, which makes sense since key escrow is kickstart-only functionality. At any rate, failure to import volume_key should only break key escrow.
Diffstat (limited to 'storage/formats')
-rw-r--r--storage/formats/luks.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/storage/formats/luks.py b/storage/formats/luks.py
index 15b92b6ba..668e6891d 100644
--- a/storage/formats/luks.py
+++ b/storage/formats/luks.py
@@ -24,7 +24,10 @@
import os
-import volume_key
+try:
+ import volume_key
+except ImportError:
+ volume_key = None
from iutil import log_method_call
from ..errors import *
@@ -266,6 +269,9 @@ class LUKS(DeviceFormat):
def escrow(self, directory, backupPassphrase):
log.debug("escrow: escrowVolume start for %s" % self.device)
+ if volume_key is None:
+ raise LUKSError("Missing key escrow support libraries")
+
vol = volume_key.Volume.open(self.device)
volume_ident = self._escrowVolumeIdent(vol)