RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1276044 - Regression: CFSNode no longer comparable to None in 2.1.fb57
Summary: Regression: CFSNode no longer comparable to None in 2.1.fb57
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-rtslib
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Maurizio Lombardi
QA Contact: Bruno Goncalves
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-28 13:42 UTC by Matthew Booth
Modified: 2021-09-03 13:47 UTC (History)
4 users (show)

Fixed In Version: python-rtslib-2.1.fb57-3.el7.noarch
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-02 14:30:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Matthew Booth 2015-10-28 13:42:33 UTC
The update from rtslib-fb-2.1.fb50 to rtslib-fb-2.1.fb57 includes the following hunk:

diff -ruN rtslib-fb-2.1.fb50/rtslib/node.py rtslib-fb-2.1.fb57/rtslib/node.py
--- rtslib-fb-2.1.fb50/rtslib/node.py   2014-09-24 18:49:44.000000000 +0100
+++ rtslib-fb-2.1.fb57/rtslib/node.py   2015-06-23 17:21:11.000000000 +0100
@@ -33,6 +33,12 @@
     def __init__(self):
         self._path = self.configfs_dir
 
+    def __eq__(self, other):
+        return self._path == other._path
+
+    def __ne__(self, other):
+        return self._path != other._path
+
     def _get_path(self):
         return self._path
 
This breaks code which does:

node == None

which then fails because NoneType doesn't have _path. Unfortunately cinder from RHOS 5 does this. This is obviously bad practice, and I will separately be submitting a patch to cinder, but this remains a regression in rtslib.

Suggest something like:

return isinstance(other, self.__class__) and self._path == other._path

which would also cover comparisons with other objects of an incorrect type.

Comment 3 Matthew Booth 2015-10-28 14:37:13 UTC
cinder bug is bug 276057

Comment 4 Matthew Booth 2015-10-28 14:37:57 UTC
Should be bug 1276057

Comment 5 Matthew Booth 2015-10-28 14:38:44 UTC
I can confirm that current cinder gets past this issue if CFSNode is updated as:

    def __eq__(self, other):
        return isinstance(other, self.__class__) and self._path == other._path

    def __ne__(self, other):
        return not self.__eq__(other)

Comment 6 Matthew Booth 2015-10-30 10:27:28 UTC
Thanks for moving so quickly on this! I just pulled the updated package from brew and updated by rhos 5 setup here. I can confirm that I can now create a instance using an iscsi volume with this updated package and without the cinder fix in place.

I have also pushed the cinder fix, so this will show up in the next build of cinder.

Comment 7 Bruno Goncalves 2015-11-03 08:58:20 UTC
python-rtslib-2.1.fb57-3.el7.noarch passed successfully in our regression test.


Note You need to log in before you can comment on or make changes to this bug.