[PATCH] Add missing pieces for kickstart's encryption cipher option.

David Lehman dlehman at redhat.com
Wed Oct 17 16:13:40 UTC 2012


---
 pyanaconda/kickstart.py            |    9 +++++----
 pyanaconda/storage/__init__.py     |    1 +
 pyanaconda/storage/partitioning.py |    2 ++
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index 4c0ef5d..3245bdb 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -241,7 +241,7 @@ class Authconfig(commands.authconfig.FC3_Authconfig):
         except RuntimeError as msg:
             log.error("Error running /usr/sbin/authconfig %s: %s", args, msg)
 
-class AutoPart(commands.autopart.F17_AutoPart):
+class AutoPart(commands.autopart.F18_AutoPart):
     def execute(self, storage, ksdata, instClass):
         from pyanaconda.storage.partitioning import doAutoPartition
 
@@ -256,6 +256,7 @@ class AutoPart(commands.autopart.F17_AutoPart):
         if self.encrypted:
             storage.encryptedAutoPart = True
             storage.encryptionPassphrase = self.passphrase
+            storage.encryptionCipher = self.cipher
             storage.autoPartEscrowCert = getEscrowCertificate(storage.escrowCertificates, self.escrowcert)
             storage.autoPartAddBackupPassphrase = self.backuppassphrase
 
@@ -548,7 +549,7 @@ class Lang(commands.lang.FC3_Lang):
     def execute(self, *args, **kwargs):
         localization.write_language_configuration(self, ROOT_PATH)
 
-class LogVol(commands.logvol.F17_LogVol):
+class LogVol(commands.logvol.F18_LogVol):
     def execute(self, storage, ksdata, instClass):
         for l in self.lvList:
             l.execute(storage, ksdata, instClass)
@@ -1080,12 +1081,12 @@ class PartitionData(commands.partition.F18_PartData):
                                      parents=request)
             storage.createDevice(luksdev)
 
-class Raid(commands.raid.F15_Raid):
+class Raid(commands.raid.F18_Raid):
     def execute(self, storage, ksdata, instClass):
         for r in self.raidList:
             r.execute(storage, ksdata, instClass)
 
-class RaidData(commands.raid.F15_RaidData):
+class RaidData(commands.raid.F18_RaidData):
     def execute(self, storage, ksdata, instClass):
         raidmems = []
         devicename = "md%d" % self.device
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
index 23f7e41..680bc27 100644
--- a/pyanaconda/storage/__init__.py
+++ b/pyanaconda/storage/__init__.py
@@ -323,6 +323,7 @@ class Storage(object):
         self.encryptedAutoPart = False
         self.autoPartType = AUTOPART_TYPE_LVM
         self.encryptionPassphrase = None
+        self.encryptionCipher = None
         self.escrowCertificates = {}
         self.autoPartEscrowCert = None
         self.autoPartAddBackupPassphrase = False
diff --git a/pyanaconda/storage/partitioning.py b/pyanaconda/storage/partitioning.py
index 0b9e99c..fda0fd1 100644
--- a/pyanaconda/storage/partitioning.py
+++ b/pyanaconda/storage/partitioning.py
@@ -76,6 +76,7 @@ def _scheduleImplicitPartitions(storage, disks):
         if storage.encryptedAutoPart:
             fmt_type = "luks"
             fmt_args = {"passphrase": storage.encryptionPassphrase,
+                        "cipher": storage.encryptionCipher,
                         "escrow_cert": storage.autoPartEscrowCert,
                         "add_backup_passphrase": storage.autoPartAddBackupPassphrase}
         else:
@@ -163,6 +164,7 @@ def _schedulePartitions(storage, disks):
         if request.encrypted and storage.encryptedAutoPart:
             fmt_type = "luks"
             fmt_args = {"passphrase": storage.encryptionPassphrase,
+                        "cipher": storage.encryptionCipher,
                         "escrow_cert": storage.autoPartEscrowCert,
                         "add_backup_passphrase": storage.autoPartAddBackupPassphrase}
         else:
-- 
1.7.6.5



More information about the anaconda-patches mailing list