Re: [PATCH] Don't traceback on CD-ROM driver in list-harddrives-stub (#586410).

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

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 04/27/2010 07:52 AM, Chris Lumens wrote:
> ---
>  command-stubs/list-harddrives-stub |    6 +++++-
>  1 files changed, 5 insertions(+), 1 deletions(-)
> 
> diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
> index e854d6c..484428d 100755
> --- a/command-stubs/list-harddrives-stub
> +++ b/command-stubs/list-harddrives-stub
> @@ -20,12 +20,16 @@
>  
>  import sys
>  import parted
> +import _ped
>  
>  def main(argv):
>      lst = set()
>  
>      for dev in filter(lambda d: d.type != parted.DEVICE_DM, parted.getAllDevices()):
> -        disk = parted.Disk(dev)
> +        try:
> +            disk = parted.Disk(dev)
> +        except _ped.DiskLabelException:
> +            continue
>  
>          for part in disk.partitions:
>              lst.add("%s %s" % (part.path, int(part.getSize())))

Looks good to me.

- -- 
Brian C. Lane <bcl@xxxxxxxxxx>
Red Hat / Port Orchard, WA
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQEVAwUBS9cUfRF+jBaO/jp/AQLU6wf+KYxLa2NGnHwugVOJ8YXQTuCcqPolNOo0
t3NRKvhw8Sb6m5cEdMaobvXCfzmzzhkbAg9UZ7YQIhDniilj1I76vF0UdxvyYcL8
ZMfGzfDKaxauYlYk/F5UyYdlNZKTdUXA1LZv+2kxDqm/BZlU3xNW9ORgCiWmZQSj
Y9uM8h746pX4llpE2rra1y5lFf34DA0Gd1AMyGlme7a9LSxD20AXBiNSwNOBqycE
Zx9lrilBvVNYo1ztgxkm+MWJbRYDKWE9M+2ft7iEQVFIbTEXhU1s/sdhJC0cM7Wd
o+lRsAQHnu/dJEoQnV0msMzQm6ejMTVU/SUuvjYuMyv66nf1WNuqDw==
=0bmI
-----END PGP SIGNATURE-----

_______________________________________________
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