Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1185466
From: Vojtech Trefny vtrefny@redhat.com
Resolves: rhbz#1185466
Signed-off-by: Vojtech Trefny vtrefny@redhat.com --- pyanaconda/kickstart.py | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index d587976..516e8d1 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -1016,6 +1016,11 @@ def execute(self, storage, ksdata, instClass): if self.passphrase and not storage.encryptionPassphrase: storage.encryptionPassphrase = self.passphrase
+ if not storage.encryptionPassphrase: + raise KickstartValueError(formatErrorMsg(self.lineno, + msg=_("Passphrase for encrypted device not specified."))) + + cert = getEscrowCertificate(storage.escrowCertificates, self.escrowcert) if self.preexist: luksformat = fmt @@ -1313,6 +1318,10 @@ def execute(self, storage, ksdata, instClass): if self.passphrase and not storage.encryptionPassphrase: storage.encryptionPassphrase = self.passphrase
+ if not storage.encryptionPassphrase: + raise KickstartValueError(formatErrorMsg(self.lineno, + msg=_("Passphrase for encrypted device not specified."))) + cert = getEscrowCertificate(storage.escrowCertificates, self.escrowcert) if self.onPart: luksformat = kwargs["fmt"] @@ -1485,6 +1494,10 @@ def execute(self, storage, ksdata, instClass): if self.passphrase and not storage.encryptionPassphrase: storage.encryptionPassphrase = self.passphrase
+ if not storage.encryptionPassphrase: + raise KickstartValueError(formatErrorMsg(self.lineno, + msg=_("Passphrase for encrypted device not specified."))) + cert = getEscrowCertificate(storage.escrowCertificates, self.escrowcert) if self.preexist: luksformat = kwargs["fmt"]
Added label: rhel7-branch.
I think these checks should go to pykickstart.
+1 for pykickstart
I am in favor of the pykickstart error-checking approach.
Unfortunately, it seems like the real bug is in the GUI, see: https://bugzilla.redhat.com/show_bug.cgi?id=1213096.
We used to prompt for missing passphrases using the anaconda UI. Is there some central switch in kickstart for whether to prompt or issue an error when such a piece of information is absent? There should be some consistency in this area.
Closed.
Some of the tests for this are in anaconda and some in pykickstarts. But I agree with Vratislav and others that we should test this in pykickstart.
Opening this again. I think this actually should be in Anaconda, because using --encrypted without --passphrase is a valid kickstart input:
"If no passphrase is specified, the default system-wide one is used, or the installer will stop and prompt if there is no default." https://github.com/vpodzime/pykickstart/blob/master-docs/docs/kickstart_docs...
Reopened.
Closed.
Closed, new version: https://github.com/rhinstaller/anaconda/pull/174
anaconda-patches@lists.fedorahosted.org