[master/f22-branch][PATCH] Try using the global LUKS passphrase if none is given for LV/part (#1196112)

Chris Lumens clumens at redhat.com
Thu Mar 5 14:39:02 UTC 2015


> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index 832810f..5385d35 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -1019,6 +1019,15 @@ class LogVolData(commands.logvol.F21_LogVolData):
>              if self.passphrase and not storage.encryptionPassphrase:
>                  storage.encryptionPassphrase = self.passphrase
>  
> +            # try to use the global passphrase if available
> +            # XXX: we require the LV/part with --passphrase to be processed
> +            # before this one to setup the storage.encryptionPassphrase
> +            self.passphrase = self.passphrase or storage.encryptionPassphrase
> +
> +            if not self.passphrase:
> +                raise KickstartValueError(formatErrorMsg(self.lineno,
> +                                                         msg="No passphrase given for encrypted LV"))
> +
>              cert = getEscrowCertificate(storage.escrowCertificates, self.escrowcert)
>              if self.preexist:
>                  luksformat = fmt

If these error messages are intended to be something the user can read
and take action on, they should be translatable.  If they're more for
our benefit, this is fine as-is.

- Chris


More information about the anaconda-patches mailing list