diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | anaconda.spec | 1 | ||||
-rw-r--r-- | fsset.py | 5 | ||||
-rw-r--r-- | iw/raid_dialog_gui.py | 1 | ||||
-rw-r--r-- | partitions.py | 2 | ||||
-rw-r--r-- | raid.py | 42 | ||||
-rw-r--r-- | textw/partition_text.py | 1 |
7 files changed, 34 insertions, 25 deletions
@@ -5,6 +5,13 @@ 2 is now "Buffers:", so this is hopelessly broken. * isys.py (ddfile): use '\x00' * num instead of os.read to make a string of '\x00' characters. + * fsset.py: make availRaidLevels be in raid.py instead of here + * partitions.py: get availRaidLevels from raid.py not fsset.py + * raid.py: move availRaidLevels here, and put it and getRaidLevels() + before the module imports, so it doesn't go boom importing sometimes + when it can't find getRaidLevels() + * iw/raid_dialog_gui.py: get availRaidLevels from raid.py + * textw/partition_text.py: get availRaidLevels from raid.py 2005-03-07 Peter Jones <pjones@redhat.com> diff --git a/anaconda.spec b/anaconda.spec index 2a79b9f47..e55b8899b 100644 --- a/anaconda.spec +++ b/anaconda.spec @@ -72,6 +72,7 @@ rm -rf $RPM_BUILD_ROOT * Thu Mar XX 2005 XXX <XXX@redhat.com> - 20.2.0.XX-X - fix swap detection on upgrade (pjones) - don't use os.read to make a buffer of '\x00' +- move availRaidLevels to raid.py from fsset.py * Mon Mar 7 2005 Peter Jones <pjones@redhat.com> - 20.2.0.27-1 - supress lvm fd warning messages @@ -47,9 +47,6 @@ else: fileSystemTypes = {} -# XXX define availraidlevels and defaultmntpts as arch characteristics -availRaidLevels = raid.getRaidLevels() - def fileSystemTypeGetDefault(): if fileSystemTypeGet('ext3').isSupported(): return fileSystemTypeGet('ext3') @@ -632,7 +629,7 @@ class raidMemberDummyFileSystem(FileSystemType): self.maxSizeMB = 8 * 1024 * 1024 self.supported = 1 - if len(availRaidLevels) == 0: + if len(raid.availRaidLevels) == 0: self.supported = 0 self.packages = [ "mdadm" ] diff --git a/iw/raid_dialog_gui.py b/iw/raid_dialog_gui.py index 8560703a1..695abe812 100644 --- a/iw/raid_dialog_gui.py +++ b/iw/raid_dialog_gui.py @@ -24,6 +24,7 @@ from rhpl.translate import _, N_ import gui from fsset import * +from raid import availRaidLevels from partRequests import * from partition_ui_helpers_gui import * from constants import * diff --git a/partitions.py b/partitions.py index fd80e618d..705300cb2 100644 --- a/partitions.py +++ b/partitions.py @@ -143,7 +143,7 @@ class Partitions: (theDev, devices, level, numActive) = raidDev level = "RAID%s" %(level,) - if level not in fsset.availRaidLevels: + if level not in raid.availRaidLevels: log("raid level %s not supported, skipping %s" %(level, theDev)) continue @@ -15,6 +15,28 @@ # """Raid probing control.""" +def getRaidLevels(): + avail = [] + try: + f = open("/proc/mdstat", "r") + except: + pass + else: + for l in f.readlines(): + if not l.startswith("Personalities"): + continue + for tok in l.split(): + for lev in ("RAID0", "RAID1", "RAID5", "RAID6"): + if tok.upper().find(lev) != -1: + avail.append(lev) + + f.close() + + return avail + +# XXX define availraidlevels and defaultmntpts as arch characteristics +availRaidLevels = raid.getRaidLevels() + import parted import isys import os @@ -196,24 +218,4 @@ def lookup_raid_device(mdname): return (dev, devices, level, numActive) raise KeyError, "md device not found" -def getRaidLevels(): - avail = [] - try: - f = open("/proc/mdstat", "r") - except: - pass - else: - for l in f.readlines(): - if not l.startswith("Personalities"): - continue - for tok in l.split(): - for lev in ("RAID0", "RAID1", "RAID5", "RAID6"): - if tok.upper().find(lev) != -1: - avail.append(lev) - - f.close() - - return avail - - diff --git a/textw/partition_text.py b/textw/partition_text.py index 8dcdce89b..cc4afaba7 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -24,6 +24,7 @@ from partedUtils import * from partIntfHelpers import * from partRequests import * from fsset import * +from raid import availRaidLevels from autopart import * from snack import * from constants_text import * |