[master/f21] Allow adding prepboot to a blank disk in custom (#1155660)

Vratislav Podzimek vpodzime at redhat.com
Thu Oct 30 09:24:36 UTC 2014


On Wed, 2014-10-29 at 10:57 -0700, Brian C. Lane wrote:
> On systems where the stage1 device can only be a partition (PPC for
> example) the self.data.bootloader.bootDrive isn't setup until you add a
> prepboot partition. If you start with a totally blank disk and added a
> prepboot partition first the accordion wouldn't be populated, resulting
> in a traceback.
> 
> This changes custom to allow biosboot and prepboot to be added when
> self.data.bootloader.bootDrive hasn't been setup yet.
> 
> This would also happen on UEFI when adding biosboot or prepboot as the
> first partition to a blank disk.
> ---
>  pyanaconda/ui/gui/spokes/custom.py | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 83b2272..60e4b98 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -308,8 +308,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>              if device.format.type not in format_types:
>                  continue
>  
> -            disk_names = [d.name for d in device.disks]
> -            if self.data.bootloader.bootDrive in disk_names:
> +            disk_names = (d.name for d in device.disks)
> +            # bootDrive may not be setup because it IS one of these.
> +            if not self.data.bootloader.bootDrive or \
> +               self.data.bootloader.bootDrive in disk_names:
>                  devices.append(device)
>  
>          return devices
Ack. And thanks for switching to generator comprehension.

-- 
Vratislav Podzimek

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




More information about the anaconda-patches mailing list