diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-05-06 10:45:47 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-05-06 10:45:47 +0200 |
commit | 96ca66b6635dd613fd9a7c4b254572c0569c23e8 (patch) | |
tree | ed985c6ae46f6824a1648c7871a35070fbe1d0d2 /isys | |
parent | bd5933855c3ec4bcb9ed321f6eea8c500181351b (diff) | |
download | anaconda-96ca66b6635dd613fd9a7c4b254572c0569c23e8.tar.gz anaconda-96ca66b6635dd613fd9a7c4b254572c0569c23e8.tar.xz anaconda-96ca66b6635dd613fd9a7c4b254572c0569c23e8.zip |
Recognize mpath iscsi setups as using iscsi (#466614)
Recognize mpath iscsi setups as using iscsi, so that iscsi-initiator-utils
gets installed.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/isys/isys.py b/isys/isys.py index 733d81d4f..406313010 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -818,7 +818,22 @@ def mediaPresent(device): return True def driveIsIscsi(device): + def convertDmToSd(minor): + slaves = [] + slavepath = "/sys/block/dm-%d/slaves" % (minor,) + if os.path.isdir(slavepath): + slaves = os.listdir(slavepath) + return slaves + # ewww. just ewww. + if re.search("mapper/mpath[0-9]*",device) is not None: + mpath = '/dev/'+ device + if os.path.exists(mpath): + minor = os.minor(os.stat(mpath).st_rdev) + sddisk = convertDmToSd(minor) + if len(sddisk) > 0: + device = sddisk[0] + if not os.path.islink("/sys/block/%s/device" %(device,)): return False target = os.readlink("/sys/block/%s/device" %(device,)) |