summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--anaconda.spec1
-rw-r--r--fsset.py5
-rw-r--r--iw/raid_dialog_gui.py1
-rw-r--r--partitions.py2
-rw-r--r--raid.py42
-rw-r--r--textw/partition_text.py1
7 files changed, 34 insertions, 25 deletions
diff --git a/ChangeLog b/ChangeLog
index 649e8dd31..f706920b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
diff --git a/fsset.py b/fsset.py
index abc3cf532..4874e4f38 100644
--- a/fsset.py
+++ b/fsset.py
@@ -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
diff --git a/raid.py b/raid.py
index d50dd203a..178eb1319 100644
--- a/raid.py
+++ b/raid.py
@@ -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 *