diff options
author | Hans de Goede <hdegoede@redhat.com> | 2009-03-17 16:34:06 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2009-03-17 19:08:38 +0100 |
commit | 2a6e841778c7b75fa09e8396d0ad9777b0a6c0e0 (patch) | |
tree | c475b636b70a609a91638410ab8e0491aa24ccf5 /storage/udev.py | |
parent | feba2676ea103d9c8ab0a89b26d213e7f17deaab (diff) | |
download | anaconda-2a6e841778c7b75fa09e8396d0ad9777b0a6c0e0.tar.gz anaconda-2a6e841778c7b75fa09e8396d0ad9777b0a6c0e0.tar.xz anaconda-2a6e841778c7b75fa09e8396d0ad9777b0a6c0e0.zip |
Get iscsi going with the new storage code
This patch gets iscsi going with the new storage code. There are still
a few hicups left (such as NetworkManager downing the interface our / is on),
but I'll address those in separate patches.
Diffstat (limited to 'storage/udev.py')
-rw-r--r-- | storage/udev.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/storage/udev.py b/storage/udev.py index 1263823ab..a6d3190cb 100644 --- a/storage/udev.py +++ b/storage/udev.py @@ -304,3 +304,33 @@ def udev_device_is_dmraid_partition(info, devicetree): return True return False + +# iscsi disks have ID_PATH in the form of: +# ip-${iscsi_address}:${iscsi_port}-iscsi-${iscsi_tgtname}-lun-${lun} +def udev_device_is_iscsi(info): + try: + path_components = info["ID_PATH"].split("-") + + if info["ID_BUS"] == "scsi" and len(path_components) >= 6 and \ + path_components[0] == "ip" and path_components[2] == "iscsi": + return True + except KeyError: + pass + + return False + +def udev_device_get_iscsi_name(info): + path_components = info["ID_PATH"].split("-") + + # Tricky, the name itself contains atleast 1 - char + return "-".join(path_components[3:len(path_components)-2]) + +def udev_device_get_iscsi_address(info): + path_components = info["ID_PATH"].split("-") + + return path_components[1].split(":")[0] + +def udev_device_get_iscsi_port(info): + path_components = info["ID_PATH"].split("-") + + return path_components[1].split(":")[1] |