[PATCH 43/47] disk.type is already a string, so we don't have to check the name attr.

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

 



From: Chris Lumens <clumens@xxxxxxxxxx>

---
 autopart.py    |    4 ++--
 partedUtils.py |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/autopart.py b/autopart.py
index f772e16..7230e9e 100644
--- a/autopart.py
+++ b/autopart.py
@@ -115,7 +115,7 @@ def bootAlphaCheckRequirements(part):
     disk = part.disk
 
     # Disklabel check
-    if not disk.type.name == "bsd":
+    if not disk.type == "bsd":
         return BOOTALPHA_NOT_BSD
 
     # The first free space should start at the begining of the drive
@@ -185,7 +185,7 @@ class partlist:
         self.parts = []
 
 def getMinimumSector(disk):
-    if disk.type.name == 'sun':
+    if disk.type == 'sun':
         (cylinders, heads, sectors) = disk.device.biosGeometry
         start = long(sectors * heads)
         start /= long(1024 / disk.device.sectorSize)
diff --git a/partedUtils.py b/partedUtils.py
index f442c64..7377148 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -139,7 +139,7 @@ def getDefaultDiskType():
 
 def hasGptLabel(diskset, device):
     disk = diskset.disks[device]
-    return disk.type.name == "gpt"
+    return disk.type == "gpt"
 
 def isEfiSystemPartition(part):
     if not part.active:
@@ -172,7 +172,7 @@ def checkDasdFmt(disk, intf):
     if not iutil.isS390():
         return 0
 
-    if disk.type.name != "dasd":
+    if disk.type != "dasd":
         return 0
 
     # FIXME: there has to be a better way to check LDL vs CDL
@@ -215,7 +215,7 @@ def checkDiskLabel(disk, intf):
             # this is kind of a hack since we don't want LDL to be used
             return checkDasdFmt(disk, intf)
     else:
-        if disk.type.name == "msdos":
+        if disk.type == "msdos":
             return 0
 
     if intf:
@@ -227,7 +227,7 @@ def checkDiskLabel(disk, intf):
                                   "ALL DATA on this drive.\n\n"
                                   "Would you like to re-initialize this "
                                   "drive?")
-                                %(disk.device.path[5:], disk.type.name,
+                                %(disk.device.path[5:], disk.type,
                                   productName), type="custom",
                                 custom_buttons = [ _("_Ignore drive"),
                                                    _("_Re-initialize drive") ],
@@ -768,7 +768,7 @@ class DiskSet:
                 continue
 
             # FIXME: this belongs in parted itself, but let's do a hack...
-            if iutil.isX86() and disk.type.name == "gpt" and not iutil.isEfi():
+            if iutil.isX86() and disk.type == "gpt" and not iutil.isEfi():
                 log.debug("syncing gpt to mbr for disk %s" % (disk.device.path,))
                 iutil.execWithRedirect("gptsync", [disk.device.path,],
                                        stdout="/tmp/gptsync.log",
-- 
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