[rhel6-branch] Filter out /dev/sr* from list-harddrives (#847600)

Vratislav Podzimek vpodzime at redhat.com
Fri Jun 28 08:29:39 UTC 2013


On Thu, 2013-06-27 at 16:09 -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl at redhat.com>
> 
> ---
>  command-stubs/list-harddrives-stub | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
> index 16279f5..0b8a4e5 100755
> --- a/command-stubs/list-harddrives-stub
> +++ b/command-stubs/list-harddrives-stub
> @@ -25,7 +25,8 @@ def main():
>  
>      def get_devices():
>          devices = parted.getAllDevices()
> -        devices = [d for d in devices if d.type != parted.DEVICE_DM]
> +        devices = [d for d in devices if d.type != parted.DEVICE_DM \
> +                               and not d.path.startswith('/dev/sr')]
>          for dev in devices:
>              path = dev.path[5:] if dev.path.startswith('/dev/') else dev.path
>              yield path, dev.getSize()
ACK.

-- 
Vratislav Podzimek

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



More information about the anaconda-patches mailing list