Re: [PATCH 1/3] Return the first qualifying device from opticalInstallMedia.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> diff --git a/pyanaconda/image.py b/pyanaconda/image.py
> index 01e01cd..7bfdb52 100644
> --- a/pyanaconda/image.py
> +++ b/pyanaconda/image.py
> @@ -176,10 +176,10 @@ def mountImage(isodir, tree, messageWindow):
>          else:
>              break
>  
> -# Return a list of Device instances containing valid optical install media
> +# Return the first Device instance containing valid optical install media
>  # for this product.
> -def opticalInstallMedia(devicetree, mountpoint="/tmp/mnt"):
> -    retval = []
> +def opticalInstallMedia(devicetree, mountpoint=INSTALL_TREE):
> +    retval = None
>  
>      for dev in devicetree.getDevicesByType("cdrom"):
>          devicetree.updateDeviceFormat(dev)
> @@ -192,7 +192,8 @@ def opticalInstallMedia(devicetree, mountpoint="/tmp/mnt"):
>              dev.format.unmount()
>              continue
>  
> -        retval.append(dev)
> +        retval = dev
> +        break
>  
>      return retval
>  

I've got a patch locally that also unmounts the device after finding it.
I'm not yet sure whether we need to do that or not.

Also, I'm debating getting rid of the verifyMedia check in
opticalInstallMedia.  It's leading to some weirdness with the
installation source spoke.

> diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py
> index b5e88c8..cfe5fec 100644
> --- a/pyanaconda/ui/gui/spokes/source.py
> +++ b/pyanaconda/ui/gui/spokes/source.py
> @@ -284,7 +284,8 @@ class SourceSpoke(NormalSpoke):
>          # If we found any optical install media, display a selector for each
>          # of those.
>          added = False
> -        for cdrom in opticalInstallMedia(self.devicetree, mountpoint=MOUNTPOINT):
> +        cdrom = opticalInstallMedia(self.devicetree, mountpoint=MOUNTPOINT)
> +        if cdrom

Missing a colon here.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux