summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2010-02-19 10:22:34 -1000
committerDavid Cantrell <dcantrell@redhat.com>2010-02-22 14:01:59 -1000
commit652eb5a8718bacefb51fe7ac4171d645f541e9b2 (patch)
tree84ea2a3320b1bf1aa6ef53c519feb54df8046e47
parentc8242ec21ee4727247e214defd1167dfc75fcbd1 (diff)
downloadanaconda-652eb5a8718bacefb51fe7ac4171d645f541e9b2.tar.gz
anaconda-652eb5a8718bacefb51fe7ac4171d645f541e9b2.tar.xz
anaconda-652eb5a8718bacefb51fe7ac4171d645f541e9b2.zip
Add getDasdPorts() to storage/dasd.py.
Reimplement the old isys.getDasdPorts() function in Python.
-rw-r--r--storage/dasd.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/storage/dasd.py b/storage/dasd.py
index 591dde0dc..20528438c 100644
--- a/storage/dasd.py
+++ b/storage/dasd.py
@@ -33,6 +33,23 @@ import gettext
_ = lambda x: gettext.ldgettext("anaconda", x)
P_ = lambda x, y, z: gettext.ldngettext("anaconda", x, y, z)
+def getDasdPorts():
+ """ Return comma delimited string of valid DASD ports. """
+ ports = []
+
+ f = open("/proc/dasd/devices", "r")
+ lines = map(lambda x: x.strip(), f.readlines())
+ f.close()
+
+ for line in lines:
+ if "unknown" in line:
+ continue
+
+ if "(FBA )" in line or "(ECKD)" in line:
+ ports.append(line.split('(')[0])
+
+ return ','.join(ports)
+
class DASD:
""" Controlling class for DASD interaction before the storage code in
anaconda has initialized.