diff options
author | Jeremy Katz <katzj@redhat.com> | 2006-06-16 01:39:47 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2006-06-16 01:39:47 +0000 |
commit | e81ad988ec435ca8ba79aae4536953777d314420 (patch) | |
tree | e34c84527b00d2c7ec371d01033f7b9db78340ec | |
parent | f36ba735655db75b52b00095e94313b8f46a1848 (diff) | |
download | anaconda-e81ad988ec435ca8ba79aae4536953777d314420.tar.gz anaconda-e81ad988ec435ca8ba79aae4536953777d314420.tar.xz anaconda-e81ad988ec435ca8ba79aae4536953777d314420.zip |
2006-06-15 Jeremy Katz <katzj@redhat.com>
* isys.py (sync): sync seems to cause an oops on s390 (#195630)
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | isys/isys.py | 36 |
2 files changed, 28 insertions, 12 deletions
@@ -1,3 +1,7 @@ +2006-06-15 Jeremy Katz <katzj@redhat.com> + + * isys.py (sync): sync seems to cause an oops on s390 (#195630) + 2006-06-16 Peter Jones <pjones@redhat.com> * iutil.py (makeDMNode): don't throw an exception if diff --git a/isys/isys.py b/isys/isys.py index 2c9e9db8f..9ec1cba04 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -26,6 +26,7 @@ import kudzu import iutil import warnings import resource +import re import rhpl import struct @@ -465,9 +466,6 @@ for d in range(80, 80 + 15): biosdisks[disk] = d def compareDrives(first, second): - type1 = first[0:2] - type2 = second[0:2] - if biosdisks.has_key(first) and biosdisks.has_key(second): one = biosdisks[first] two = biosdisks[second] @@ -476,17 +474,21 @@ def compareDrives(first, second): elif (one > two): return 1 - if type1 == "hd": - type1 = 0 - elif type1 == "sd": - type1 = 1 + if first.startswith("hd"): + type1 = 0 + elif first.startswith("sd"): + type1 = 1 + elif first.startswith("xvd"): + type1 = -1 else: - type1 = 2 + type1 = 2 - if type2 == "hd": - type2 = 0 - elif type2 == "sd": + if second.startswith("hd"): + type2 = 0 + elif second.startswith("sd"): type2 = 1 + elif second.startswith("xvd"): + type2 = -1 else: type2 = 2 @@ -789,6 +791,15 @@ def driveIsRemovable(device): return False +def driveIsIscsi(device): + # ewww. just ewww. + if not os.path.islink("/sys/block/%s/device" %(device,)): + return False + target = os.readlink("/sys/block/%s/device" %(device,)) + if re.search("/platform/host[0-9]*/session[0-9]*/target[0-9]*:[0-9]*:[0-9]*/[0-9]*:[0-9]*:[0-9]*:[0-9]*", target) is not None: + return True + return False + def vtActivate (num): _isys.vtActivate (num) @@ -796,7 +807,8 @@ def isPsudoTTY (fd): return _isys.isPsudoTTY (fd) def sync (): - return _isys.sync () + if rhpl.getArch() not in ("s390", "s390x"): + return _isys.sync () def isIsoImage(file): return _isys.isisoimage(file) |