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 Handle errors probing filesystems on RAID and LVM partitions.

From: Chris Lumens <clumens@redhat.com>

---
partedUtils.py | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/partedUtils.py b/partedUtils.py
index 40c31ae..f442c64 100644
--- a/partedUtils.py
+++ b/partedUtils.py
@@ -266,13 +266,17 @@ def validateFsType(part):
if not part.type in (parted.PARTITION_NORMAL,
parted.PARTITION_LOGICAL):
return
+
+ if part.getFlag(parted.PARTITION_LVM) or part.getFlag(parted.PARTITION_RAID):
+ return
+
# if the partition already has a type, no need to search
if part.fileSystem:
return

# first fsystem to probe wins, so sort the types into a preferred
# order.
- fsnames = fsTypes.keys()
+ fsnames = parted.fileSystemType.keys()
goodTypes = ['ext3', 'ext2']
badTypes = ['linux-swap',]
for fstype in goodTypes:
@@ -284,18 +288,20 @@ def validateFsType(part):

# now check each type, and set the partition system accordingly.
for fsname in fsnames:
- fstype = fsTypes[fsname]
- if parted.probeForSpecificFileSystem(fstype, part.geometry) != None:
+ fstype = parted.fileSystemType[fsname]
+ try:
+ parted.probeForSpecificFileSystem(fstype.name, part.geometry)
# XXX verify that this will not modify system type
# in the case where a user does not modify partitions
part.system = fstype
return
+ except (parted.FileSystemException, parted.IOException):
+ pass

def isLinuxNative(part):
"""Check if the type is a 'Linux native' filesystem."""
- fstype = part._fileSystem._type
- if part.getFlag(parted.PARTITION_RAID) or parted.getFlag(parted.PARTITION_LVM) or
- part.getFlag(parted.PARTITION_SWAP) or fstype.name in ["ext2", "ext3", "jfs", "reiserfs", "xfs"]:
+ if part.getFlag(parted.PARTITION_RAID) or part.getFlag(parted.PARTITION_LVM) or
+ part.getFlag(parted.PARTITION_SWAP) or part._fileSystem._type.name in ["ext2", "ext3", "jfs", "reiserfs", "xfs"]:
return True
else:
return False
--
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 12:44 AM.

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