summaryrefslogtreecommitdiffstats
path: root/isys/isys.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2004-05-11 22:22:37 +0000
committerJeremy Katz <katzj@redhat.com>2004-05-11 22:22:37 +0000
commit92346671951637c004efe813b7bb2b385ae5846b (patch)
tree49202ea9dc32cb421185110953db7b1d7d8ed9a0 /isys/isys.py
parentd3730ca46577bfb35e3f30eb44f7e1ba18c4f9bb (diff)
downloadanaconda-92346671951637c004efe813b7bb2b385ae5846b.tar.gz
anaconda-92346671951637c004efe813b7bb2b385ae5846b.tar.xz
anaconda-92346671951637c004efe813b7bb2b385ae5846b.zip
merge some s390 fixes from the rhel3 branch. a cosmetic change and a fix
for finding the properly formatted dasd
Diffstat (limited to 'isys/isys.py')
-rw-r--r--isys/isys.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/isys/isys.py b/isys/isys.py
index 7532490f8..868fddee2 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -345,13 +345,34 @@ def getDasdDevPort():
dasdnum = line[:index]
start = line[index:].find("dasd")
- end = line[start:].find(":")
- dev = line[start:end + start].strip()
+ end = line[index + start:].find(":")
+ dev = line[index + start:end + start + index].strip()
ret[dev] = dasdnum
return ret
++# get active/ready state of a dasd device
++# returns 0 if we're fine, 1 if not
+def getDasdState(dev):
+ devs = getDasdDevPort()
+ if not devs.has_key(dev):
+ log("don't have %s in /dev/dasd/devices!" %(dev,))
+ return 0
+
+ f = open("/proc/dasd/devices", "r")
+ lines = f.readlines()
+ f.close()
+
+ for line in lines:
+ if not line.startswith(devs[dev]):
+ continue
+ if line.find(" ready") != -1:
+ return 1
+
+ return 0
+
+
def makeDevInode(name, fn=None):
if fn:
_isys.mkdevinode(name, fn)