[rhel6] Allow /dev/disk/by-* in bootloader --driveorder (#890095)

Vratislav Podzimek vpodzime at redhat.com
Fri Jul 12 07:45:13 UTC 2013


On Thu, 2013-07-11 at 15:56 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> Dereference the bootloader --driveorder devices before trying to use
> them. This allows use of any of the various ways to specify a drive.
> 
> Resolves: rhbz#890095
> ---
>  kickstart.py | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/kickstart.py b/kickstart.py
> index 6231d38..2fd4e38 100644
> --- a/kickstart.py
> +++ b/kickstart.py
> @@ -258,6 +258,21 @@ class AutoStep(commands.autostep.FC3_AutoStep):
>          flags.autoscreenshot = self.autoscreenshot
>  
>  class Bootloader(commands.bootloader.RHEL6_Bootloader):
> +    def parse(self, args):
> +        retval = commands.bootloader.RHEL6_Bootloader.parse(self, args)
> +
> +        # Expand the drives in driveorder so that things like /dev/disk/by-* will work
> +        drives = []
> +        for drive in self.driveorder:
> +            matched = deviceMatches(drive)
> +            if matched:
> +                drives.extend(matched)
> +            else:
> +                raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent disk %s in bootloader command" % drive)
> +        self.driveorder = drives
> +
> +        return retval
> +
>      def execute(self, anaconda):
>          if self.location == "none":
>              location = None
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list