Yaniv Bronhaim has submitted this change and it was merged. Change subject: issci: Fix equality and hash when username or password are None ......................................................................
issci: Fix equality and hash when username or password are None When fetching iscsi session info, username of password can be None, but iscsi.ChapCredentials was not handling these values correctly in __eq__ and __hash__. In particular, we used to compare password.value and include it in the hash. This would raise AttributeError when password is None. Now all combinations are handled properly; we compare password objects, using ProtectedPassword.__eq__, and include hash(password), using ProtectedPassword.__hash__. This issue was hidden because practically username is None when password is None, and the equality test fail before we try to compare None.value. The hash issue is hidden because we never use __hash__ for ChapCredentials. So this is mainly a correctness fix that should not effect current code, but it may be needed for fixing the related bug. Change-Id: I95bda5d07506ecbfb76ec5397717fe05b53f97ec Bug-Url: https://bugzilla.redhat.com/1279485 Signed-off-by: Nir Soffer <nsof...@redhat.com> Reviewed-on: https://gerrit.ovirt.org/48480 Reviewed-by: Allon Mureinik <amure...@redhat.com> Reviewed-by: Ala Hino <ah...@redhat.com> Continuous-Integration: Jenkins CI Reviewed-by: Freddy Rolland <froll...@redhat.com> Reviewed-by: Adam Litke <ali...@redhat.com> Reviewed-on: https://gerrit.ovirt.org/50939 Reviewed-by: Yaniv Bronhaim <ybron...@redhat.com> --- M lib/vdsm/password.py M tests/iscsiTests.py M vdsm/storage/iscsi.py 3 files changed, 46 insertions(+), 19 deletions(-) Approvals: Nir Soffer: Verified Yaniv Bronhaim: Looks good to me, approved Jenkins CI: Passed CI tests Allon Mureinik: Looks good to me, but someone else must approve Freddy Rolland: Looks good to me, but someone else must approve Ala Hino: Looks good to me, but someone else must approve -- To view, visit https://gerrit.ovirt.org/50939 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95bda5d07506ecbfb76ec5397717fe05b53f97ec Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: ovirt-3.6 Gerrit-Owner: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Adam Litke <ali...@redhat.com> Gerrit-Reviewer: Ala Hino <ah...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Francesco Romani <from...@redhat.com> Gerrit-Reviewer: Freddy Rolland <froll...@redhat.com> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com> Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org> _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches