[PATCH rhel7] iscsi: fall back to session initiator name for null offload name (#836307)
Martin Gracik
mgracik at redhat.com
Thu Jul 12 11:40:08 UTC 2012
ack, with one comment
----- Original Message -----
> Resolves: rhbz#836307
>
> Tested by reporter to fix the issue.
> ---
> pyanaconda/storage/udev.py | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/pyanaconda/storage/udev.py b/pyanaconda/storage/udev.py
> index 9b1e8da..855ee70 100644
> --- a/pyanaconda/storage/udev.py
> +++ b/pyanaconda/storage/udev.py
> @@ -585,11 +585,16 @@ def udev_device_get_iscsi_initiator(info):
> initiator_file =
> "/sys/class/iscsi_host/%s/initiatorname" % host
> if os.access(initiator_file, os.R_OK):
> initiator = open(initiator_file).read().strip()
> + log.debug("found offload iscsi initiatorname %s in
> file %s" %
> + (initiator, initiator_file))
> + if initiator.lstrip("(").rstrip(")").lower() ==
> "null":
wouldn't this be easier to read?
if initiator.lower() == "(null)":
> + initiator = None
> if initiator is None:
> session = udev_device_get_iscsi_session(info)
> if session:
> initiator =
> open("/sys/class/iscsi_session/%s/initiatorname" %
> session).read().strip()
> + log.debug("found iscsi initiatorname %s" % initiator)
> return initiator
>
>
> --
> 1.7.4
>
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/anaconda-patches
>
More information about the anaconda-patches
mailing list