FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Masters Of The Universe

 
 
LinkBack Thread Tools
 
Old 02-11-2009, 11:54 PM
David Cantrell
 
Default disk.type is already a string, so we don't have to check the name attr.

From: Chris Lumens <clumens@redhat.com>

---
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.

"
"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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 08:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org