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": + 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
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 infile %s" %
(initiator, initiator_file))if initiator.lstrip("(").rstrip(")").lower() =="null":
wouldn't this be easier to read?
if initiator.lower() == "(null)":
if initiator is None: session = udev_device_get_iscsi_session(info) if session: initiator = open("/sys/class/iscsi_session/%s/initiatorname" % session).read().strip()initiator = None return initiatorlog.debug("found iscsi initiatorname %s" % initiator)-- 1.7.4
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/anaconda-patches
On 07/12/2012 01:40 PM, 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 infile %s" %
(initiator, initiator_file))if initiator.lstrip("(").rstrip(")").lower() =="null":
wouldn't this be easier to read?
if initiator.lower() == "(null)":
My version will accept also "null" which is intentional.
Radek
On 07/12/2012 05:00 AM, Radek Vykydal wrote:
if initiator.lower() == "(null)":
My version will accept also "null" which is intentional.
Sounds like it's somewhat freeform what we might get back here. Would it make more sense to use a regex to catch things with "null" in them?
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 infile %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.
if initiator is None: session = udev_device_get_iscsi_session(info) if session: initiator = open("/sys/class/iscsi_session/%s/initiatorname" % session).read().strip()initiator = None return initiatorlog.debug("found iscsi initiatorname %s" % initiator)-- 1.7.4
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches mailing list anaconda-patches@lists.fedorahosted.org https://fedorahosted.org/mailman/listinfo/anaconda-patches
anaconda-patches@lists.fedorahosted.org