summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--isys/isys.py36
-rw-r--r--iutil.py2
3 files changed, 29 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index ba1393b32..406f1ffd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-08-18 Peter Jones <pjones@redhat.com>
+ * iutil.py (makeDriveDeviceNodes): don't call isys.flushDriveDict()
+
+ * isys/isys.py (driveDict): don't recompute cachedDrives unless it's
+ empty. Return a subset of it based on the "klassdevice" or similar.
+
+2006-08-18 Peter Jones <pjones@redhat.com>
+
* iw/partition_ui_helpers_gui.py (WideCheckList.__init__): Don't set
the selection mode to gtk.SELECTION_NONE. AFAICT, all this does is
make it so you can't check or uncheck drives for installation using
diff --git a/isys/isys.py b/isys/isys.py
index f03684b51..a794ab76e 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -29,6 +29,7 @@ import resource
import re
import rhpl
import struct
+import block
import logging
log = logging.getLogger("anaconda")
@@ -267,21 +268,28 @@ def flushDriveDict():
def driveDict(klassArg):
global cachedDrives
- if cachedDrives is not None:
- return cachedDrives
-
- ret = {}
+ if cachedDrives is None:
+ # FIXME: need to add dasd probing to kudzu
+ devs = kudzu.probe(kudzu.CLASS_HD | kudzu.CLASS_CDROM | \
+ kudzu.CLASS_FLOPPY,
+ kudzu.BUS_UNSPEC, kudzu.PROBE_SAFE)
+ new = {}
+ for dev in devs:
+ if dev.device is None: # none devices make no sense
+ continue
+ new[dev.device] = dev
+ cachedDrives = new
- # FIXME: need to add dasd probing to kudzu
- devs = kudzu.probe(kudzu.CLASS_HD | kudzu.CLASS_CDROM | kudzu.CLASS_FLOPPY,
- kudzu.BUS_UNSPEC, kudzu.PROBE_SAFE)
- for dev in devs:
- if dev.device is None: # none devices make no sense
- continue
- if dev.deviceclass == classMap[klassArg]:
- ret[dev.device] = dev.desc
-
- cachedDrives = ret
+ ret = {}
+ for key,dev in cachedDrives.items():
+ # XXX these devices should have deviceclass attributes. Or they
+ # should all be subclasses in a device tree and we should be able
+ # to use isinstance on all of them. Not both.
+ if klassArg == "disk" and (isinstance(dev, block.MultiPath) or \
+ isinstance(dev, block.RaidSet)):
+ ret[key] = dev
+ elif dev.deviceclass == classMap[klassArg]:
+ ret[key] = dev.desc
return ret
def hardDriveDict():
diff --git a/iutil.py b/iutil.py
index a606f7ddd..77138c9a1 100644
--- a/iutil.py
+++ b/iutil.py
@@ -215,7 +215,6 @@ def makeCharDeviceNodes():
# make the device nodes for all of the drives on the system
def makeDriveDeviceNodes():
- isys.flushDriveDict()
hardDrives = isys.hardDriveDict()
for drive in hardDrives.keys():
if drive.startswith("mapper"):
@@ -239,7 +238,6 @@ def makeDriveDeviceNodes():
dev = "%s%s%d" % (drive, sep, i)
isys.makeDevInode(dev, "/dev/%s" % (dev,))
- isys.flushDriveDict()
cdroms = isys.cdromList()
for drive in cdroms:
isys.makeDevInode(drive, "/dev/%s" % (drive,))