[PATCH rhel7] iscsi: fall back to session initiator name for null offload name (#836307)

Vratislav Podzimek vpodzime at redhat.com
Thu Jul 12 12:02:08 UTC 2012


On Thu, 2012-07-12 at 07:40 -0400, Martin Gracik wrote:
> 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)":
If there is no chance that initiator.lower() would be "((null))", then I
think it's better.

> 
> > +                    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
> > 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://fedorahosted.org/mailman/listinfo/anaconda-patches

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list