diff options
author | Joel Granados Moreno <jgranado@redhat.com> | 2009-04-15 11:25:55 +0200 |
---|---|---|
committer | Joel Granados Moreno <jgranado@redhat.com> | 2009-04-16 11:14:52 +0200 |
commit | 29a78c55295af2051bcce70f1eefdcac04c9aae7 (patch) | |
tree | 25350bcf33479ca5787244e03a441c58e9771daa /storage/__init__.py | |
parent | 71466837dac557eea1fad9b4cddb6a428719cf50 (diff) | |
download | anaconda-29a78c55295af2051bcce70f1eefdcac04c9aae7.tar.gz anaconda-29a78c55295af2051bcce70f1eefdcac04c9aae7.tar.xz anaconda-29a78c55295af2051bcce70f1eefdcac04c9aae7.zip |
Implement the save to USB using devicetree devices.
Diffstat (limited to 'storage/__init__.py')
-rw-r--r-- | storage/__init__.py | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/storage/__init__.py b/storage/__init__.py index 8678b6e81..5deb6eea1 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 |