[PATCH 28/47] Use correct attribute on FileSystem objects.

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

 



The type of the filesystem is a string available via the 'type'
attribute.  Use the type as the key for the parted.fileSystemType
hash.
---
 partedUtils.py |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/partedUtils.py b/partedUtils.py
index 037fe1d..54abfa8 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -63,19 +63,19 @@ def get_partition_file_system_type(part):
     elif part.fileSystem == None:
         return None
     elif (part.getFlag(parted.PARTITION_BOOT) and
-          part.getSize(unit="MB") <= 1 and part.fileSystem.name == "hfs"):
+          part.getSize(unit="MB") <= 1 and part.fileSystem.type == "hfs"):
         ptype = fsset.fileSystemTypeGet("Apple Bootstrap")
-    elif part.fileSystem.name == "linux-swap":
+    elif part.fileSystem.type == "linux-swap":
         ptype = fsset.fileSystemTypeGet("swap")
     elif isEfiSystemPartition(part):
         ptype = fsset.fileSystemTypeGet("efi")
     elif isEfiSystemPartition(part):
         ptype = fsset.fileSystemTypeGet("efi")
-    elif part.fileSystem.name in ("fat16", "fat32"):
+    elif part.fileSystem.type in ("fat16", "fat32"):
         ptype = fsset.fileSystemTypeGet("vfat")
     else:
         try:
-            ptype = fsset.fileSystemTypeGet(part.fileSystem.name)
+            ptype = fsset.fileSystemTypeGet(part.fileSystem.type)
         except:
             ptype = fsset.fileSystemTypeGet("foreign")
 
@@ -144,10 +144,10 @@ def hasGptLabel(diskset, device):
 def isEfiSystemPartition(part):
     if not part.active:
         return False
-    return (part.disk.type.name == "gpt" and
+    return (part.disk.type == "gpt" and
             part.name == "EFI System Partition" and
             part.getFlag(parted.PARTITION_BOOT) and
-            part.fileSystem.name in ("fat16", "fat32") and
+            part.fileSystem.type in ("fat16", "fat32") and
             isys.readFSLabel(part.getDeviceNodeName()) != "ANACONDA")
 
 def labelDisk(deviceFile, forceLabelType=None):
@@ -1110,7 +1110,7 @@ class DiskSet:
                                  parted.PARTITION_LOGICAL):
                     device = part.getDeviceNodeName()
                     if part.fileSystem:
-                        ptype = part.fileSystem.name
+                        ptype = part.fileSystem.type
                     else:
                         ptype = None
                     rc.append((device, ptype))
@@ -1139,7 +1139,7 @@ class DiskSet:
                     if part.number > 0:
                         device = part.getDeviceNodeName()
                     if part.fileSystem:
-                        fs_type_name = part.fileSystem.name
+                        fs_type_name = part.fileSystem.type
                     partFlags = part.getFlagsAsString()
                     rc = rc + ("%-9s %-12s %-12s %-10ld %-10ld %-10ld %7s\n"
                                % (device, part.type.name, fs_type_name,
@@ -1167,7 +1167,7 @@ class DiskSet:
 
         drives = []
         for d in isys.removableDriveDict().items():
-            func = lambda p: p.active and not p.getFlag(parted.PARTITION_RAID) and not p.getFlag(parted.PARTITION_LVM) and p.fileSystem.name in ["ext3", "ext2", "fat16", "fat32"]
+            func = lambda p: p.active and not p.getFlag(parted.PARTITION_RAID) and not p.getFlag(parted.PARTITION_LVM) and p.fileSystem.type in ["ext3", "ext2", "fat16", "fat32"]
 
             disk = self.disks[d[0]]
             parts = filter_partitions(disk, func)
-- 
1.6.1.3

_______________________________________________
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