On Wed, Apr 15, 2009 at 04:05:17PM +0200, Hans de Goede wrote: > What if part does not have a format? Not sure if this > can happen, but better safe then sorry. Don't know if can actually happen, I'll add the check. > > Regards, > > Hans > > > On 04/15/2009 03:57 PM, Joel Granados Moreno wrote: >> --- >> storage/__init__.py | 29 +++++++++++++---------------- >> 1 files changed, 13 insertions(+), 16 deletions(-) >> >> diff --git a/storage/__init__.py b/storage/__init__.py >> index 8678b6e..5deb6ee 100644 >> --- a/storage/__init__.py >> +++ b/storage/__init__.py >> @@ -456,25 +456,22 @@ class Storage(object): >> self.reset() >> >> dests = [] >> - for device in self.devices: >> - if not device.removable: >> - continue >> >> - try: >> - dev = parted.Device(path=device.path) >> - disk = parted.Disk(device=dev) >> - except Exception: >> - continue >> + for part in self.disks: >> + if not disk.removable and \ >> + disk.format is not None and \ >> + disk.format.mountable: >> + dests.append([disk.path, disk.name]) >> >> - for part in disk.partitions: >> - if part.active and \ >> - not part.getFlag(parted.PARTITION_RAID) and \ >> - not part.getFlag(parted.PARTITION_LVM) and \ >> - part.fileSystem.type in ("ext3", "ext2", "fat16", "fat32"): >> - dests.append([part.path, device.name]) >> + for part in self.partitions: >> + if not part.disk.removable: >> + continue >> >> - if not disk.partitions: >> - dests.append([device.path, device.name]) >> + elif part.partedPartition.active and \ >> + not part.partedPartition.getFlag(parted.PARTITION_RAID) and \ >> + not part.partedPartition.getFlag(parted.PARTITION_LVM) and \ >> + part.format.mountable: >> + dests.append([part.path, part.name]) >> >> return dests >> > > _______________________________________________ > Anaconda-devel-list mailing list > Anaconda-devel-list@xxxxxxxxxx > https://www.redhat.com/mailman/listinfo/anaconda-devel-list -- Joel Andres Granados Brno, Czech Republic, Red Hat. _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list