[PATCH] Only initialize escrow packet code if there's devices that need it (#527668).

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

 



---
 storage/__init__.py |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/storage/__init__.py b/storage/__init__.py
index 0f71d3c..54fec41 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -171,6 +171,12 @@ def storageComplete(anaconda):
         return DISPATCH_BACK
 
 def writeEscrowPackets(anaconda):
+    escrowDevices = map(lambda d: d.format.type == "luks" and not d.format.escrow_cert,
+                        anaconda.id.storage.devices)
+
+    if not escrowDevices:
+        return
+
     log.debug("escrow: writeEscrowPackets start")
 
     wait_win = anaconda.intf.waitWindow(_("Running..."),
@@ -180,13 +186,11 @@ def writeEscrowPackets(anaconda):
 
     backupPassphrase = generateBackupPassphrase()
     try:
-        for device in anaconda.id.storage.devices:
+        for device in escrowDevices:
             log.debug("escrow: device %s: %s" %
                       (repr(device.path), repr(device.format.type)))
-            if (device.format.type == "luks" and
-                device.format.escrow_cert is not None):
-                device.format.escrow(anaconda.rootPath + "/root",
-                                     backupPassphrase)
+            device.format.escrow(anaconda.rootPath + "/root",
+                                 backupPassphrase)
 
         wait_win.pop()
     except (IOError, RuntimeError) as e:
-- 
1.6.4.2

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

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux