Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does not work in PY2

Bug #1586268 reported by yuyafei on 2016-05-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Kosmos
Undecided
Ji.Wei
Panko
Undecided
Hanxi Liu
daisycloud-core
Undecided
Ji.Wei
octavia
Low
Ji.Wei
python-congressclient
Undecided
yuyafei
python-karborclient
Undecided
yuyafei
python-muranoclient
Undecided
yuyafei
taskflow
Undecided
Ji.Wei

Bug Description

Version: master(20160527)

In case cinderclient.tests.unit.test_base.BaseTest.test_eq self.assertNotEqual does not work.
Class base.Resource defines __eq__() built-in function, but does not define __ne__() built-in function, so self.assertEqual works but self.assertNotEqual does not work at all in this test case.

steps:
1 Clone code of python-cinderclient from master.
2 Modify the case of unit test: cinderclient/tests/unit/test_base.py
  line50--line62.
    def test_eq(self):
        # Two resources with same ID: never equal if their info is not equal
        r1 = base.Resource(None, {'id': 1, 'name': 'hi'})
        r2 = base.Resource(None, {'id': 1, 'name': 'hello'})
        self.assertNotEqual(r1, r2)

        # Two resources with same ID: equal if their info is equal
        r1 = base.Resource(None, {'id': 1, 'name': 'hello'})
        r2 = base.Resource(None, {'id': 1, 'name': 'hello'})
        # self.assertEqual(r1, r2)
        self.assertNotEqual(r1, r2)

        # Two resoruces of different types: never equal
        r1 = base.Resource(None, {'id': 1})
        r2 = volumes.Volume(None, {'id': 1})
        self.assertNotEqual(r1, r2)

        # Two resources with no ID: equal if their info is equal
        r1 = base.Resource(None, {'name': 'joe', 'age': 12})
        r2 = base.Resource(None, {'name': 'joe', 'age': 12})
        # self.assertEqual(r1, r2)
        self.assertNotEqual(r1, r2)

   Modify self.assertEqual(r1, r2) to self.assertNotEqual(r1, r2).

3 Run unit test, and return success.

After that, I make a test:

class Resource(object):
    def __init__(self, person):
        self.person = person

    def __eq__(self, other):
        return self.person == other.person

r1 = Resource("test")
r2 = Resource("test")
r3 = Resource("test_r3")
r4 = Resource("test_r4")

print r1 != r2
print r1 == r2
print r3 != r4
print r3 == r4

The result is :
True
True
True
False

Whether r1 is precisely the same to r2 or not, self.assertNotEqual(r1, r2) return true.So I think self.assertNotEqual doesn't work at all in python2 and should be modified.

yuyafei (yu-yafei) on 2016-05-27
tags: added: unittest
yuyafei (yu-yafei) on 2016-05-27
description: updated
Changed in python-cinderclient:
assignee: nobody → jingtao liang (liang-jingtao)
Changed in python-cinderclient:
status: New → In Progress
yuyafei (yu-yafei) on 2016-05-27
description: updated
description: updated
Eric Harney (eharney) on 2016-05-27
tags: added: tests
removed: unittest
yuyafei (yu-yafei) on 2016-05-28
Changed in python-cinderclient:
assignee: jingtao liang (liang-jingtao) → yuyafei (yu-yafei)

Change abandoned by yuyafei (<email address hidden>) on branch: master
Review: https://review.openstack.org/322376

yuyafei (yu-yafei) on 2016-05-30
description: updated
summary: - Unit test: unit.test_base.BaseTest.test_eq does not work
+ Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does
+ not work
yuyafei (yu-yafei) on 2016-06-01
description: updated
yuyafei (yu-yafei) on 2016-06-01
description: updated
yuyafei (yu-yafei) on 2016-06-01
description: updated
yuyafei (yu-yafei) on 2016-06-15
description: updated
yuyafei (yu-yafei) on 2016-07-04
description: updated
yuyafei (yu-yafei) on 2016-07-04
Changed in python-novaclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-keystoneclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-heatclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-manilaclient:
assignee: nobody → yuyafei (yu-yafei)
summary: Unit test: self.assertNotEqual in unit.test_base.BaseTest.test_eq does
- not work
+ not work in PY2

Fix proposed to branch: master
Review: https://review.openstack.org/337012

Changed in python-novaclient:
status: New → In Progress
yuyafei (yu-yafei) on 2016-07-04
Changed in python-glanceclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-troveclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-muranoclient:
assignee: nobody → yuyafei (yu-yafei)
Ji.Wei (jiwei) on 2016-07-04
Changed in tempest:
assignee: nobody → Ji.Wei (jiwei)
Changed in nova:
assignee: nobody → Ji.Wei (jiwei)
Changed in ceilometer:
assignee: nobody → Ji.Wei (jiwei)
Changed in neutron:
assignee: nobody → Ji.Wei (jiwei)
Changed in swift:
assignee: nobody → Ji.Wei (jiwei)
Changed in rally:
assignee: nobody → Ji.Wei (jiwei)
yuyafei (yu-yafei) on 2016-07-04
Changed in python-congressclient:
assignee: nobody → yuyafei (yu-yafei)
Ji.Wei (jiwei) on 2016-07-04
Changed in python-congressclient:
assignee: yuyafei (yu-yafei) → Ji.Wei (jiwei)
yuyafei (yu-yafei) on 2016-07-04
Changed in python-smaugclient:
assignee: nobody → yuyafei (yu-yafei)
Ji.Wei (jiwei) on 2016-07-04
Changed in python-congressclient:
assignee: Ji.Wei (jiwei) → nobody
yuyafei (yu-yafei) on 2016-07-04
no longer affects: cloudkitty
Ji.Wei (jiwei) on 2016-07-04
Changed in daisycloud-core:
assignee: nobody → Ji.Wei (jiwei)
Changed in keystonemiddleware:
assignee: nobody → Ji.Wei (jiwei)
Changed in keystone:
assignee: nobody → Ji.Wei (jiwei)
Changed in heat:
assignee: nobody → Ji.Wei (jiwei)
Ji.Wei (jiwei) on 2016-07-04
Changed in glance:
assignee: nobody → Ji.Wei (jiwei)
yuyafei (yu-yafei) on 2016-07-04
Changed in python-ceilometerclient:
assignee: nobody → yuyafei (yu-yafei)
Changed in python-congressclient:
assignee: nobody → yuyafei (yu-yafei)
Ji.Wei (jiwei) on 2016-07-04
Changed in cinder:
assignee: nobody → Ji.Wei (jiwei)
Changed in python-swiftclient:
assignee: nobody → Ji.Wei (jiwei)

Fix proposed to branch: master
Review: https://review.openstack.org/337031

Changed in python-heatclient:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/337033

Changed in python-ceilometerclient:
status: New → In Progress
yuyafei (yu-yafei) on 2016-07-04
no longer affects: python-cloudkittyclient (Ubuntu)

I think this is true. I executed this piece of code under different python
versions:

    class Resource(object):
    def __init__(self, person):
        self.person = person

    def __eq__(self, other):
        return self.person == other.person

    r1 = Resource("test")
    r2 = Resource("test")
    r3 = Resource("test_r3")
    r4 = Resource("test_r4")

    print(r1 != r2)
    print(r1 == r2)
    print(r3 != r4)
    print(r3 == r4)

Python 2.7.10 Python 3.5.1
------------------------------
        True False
        True True
        True True
        False False

Also, The python3 doc [1] says:

    "By default, __ne__() delegates to __eq__() and inverts the result
    unless it is NotImplemented. There are no other implied relationships
    among the comparison operators"

whereas the python2 doc [2] says:

    "There are no implied relationships among the comparison operators."

I think this behavior change got introduced in python with [3]. As long as
we support python2, a change seems to be reasonable.

References:
[1] https://docs.python.org/3/reference/datamodel.html#object.__ne__
[2] https://docs.python.org/2.7/reference/datamodel.html#object.__ne__
[3] http://bugs.python.org/issue21408

Changed in nova:
importance: Undecided → High
status: New → Confirmed
Ji.Wei (jiwei) on 2016-07-05
Changed in horizon:
assignee: nobody → Ji.Wei (jiwei)

Fix proposed to branch: master
Review: https://review.openstack.org/337394

Changed in nova:
assignee: Ji.Wei (jiwei) → yuyafei (yu-yafei)
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/337031
Committed: https://git.openstack.org/cgit/openstack/python-heatclient/commit/?id=4c2a88b95905ab724a5fff5b19ff10c1ca43f4a3
Submitter: Jenkins
Branch: master

commit 4c2a88b95905ab724a5fff5b19ff10c1ca43f4a3
Author: yuyafei <email address hidden>
Date: Mon Jul 4 16:17:51 2016 +0800

    base.Resource not define __ne__() built-in function

    Class base.Resource defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it by defining __eq__() built-in function
    of class base.Resource.

    Change-Id: I13ed9ddd6ae6ef074232b33695916bc83930dcf0
    Closes-Bug: #1586268

Changed in python-heatclient:
status: In Progress → Fix Released

Fix proposed to branch: master
Review: https://review.openstack.org/337429

Changed in python-glanceclient:
status: New → In Progress
Changed in python-congressclient:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/337435

Changed in python-keystoneclient:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/337439

Changed in python-muranoclient:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/337445

Changed in python-smaugclient:
status: New → In Progress
Changed in python-troveclient:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/337602

Changed in glance:
status: New → In Progress

Reviewed: https://review.openstack.org/322408
Committed: https://git.openstack.org/cgit/openstack/python-cinderclient/commit/?id=ccde9b3ba78e2dd0f2a726e6d23dba91f8ee061f
Submitter: Jenkins
Branch: master

commit ccde9b3ba78e2dd0f2a726e6d23dba91f8ee061f
Author: yuyafei <email address hidden>
Date: Sat May 28 16:10:15 2016 +0800

    base.Resource not define __ne__() built-in function

    Class base.Resource defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it by defining __ne__() built-in function
    of class base.Resource. Also fixes spelling errors:resoruces.

    Change-Id: I845d531880ad74d928a3e15335ed10e71590826e
    Closes-Bug: #1586268

Changed in python-cinderclient:
status: In Progress → Fix Released
Ji.Wei (jiwei) on 2016-07-05
no longer affects: cinder
no longer affects: keystone
Ji.Wei (jiwei) on 2016-07-05
no longer affects: rally

Change abandoned by yuyafei (<email address hidden>) on branch: master
Review: https://review.openstack.org/337394

yuyafei (yu-yafei) on 2016-07-06
Changed in nova:
assignee: yuyafei (yu-yafei) → Ji.Wei (jiwei)

Change abandoned by JiWei (<email address hidden>) on branch: master
Review: https://review.openstack.org/337602

Reviewed: https://review.openstack.org/337439
Committed: https://git.openstack.org/cgit/openstack/python-muranoclient/commit/?id=04e0e1e553c37114a4292af5e82642cdc6104555
Submitter: Jenkins
Branch: master

commit 04e0e1e553c37114a4292af5e82642cdc6104555
Author: yuyafei <email address hidden>
Date: Tue Jul 5 15:31:54 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

    Change-Id: Ia6c59f690917a7a39d02072ceb339779296bdb91
    Closes-Bug: #1586268

Changed in python-muranoclient:
status: In Progress → Fix Released
Changed in python-novaclient:
assignee: yuyafei (yu-yafei) → Andrey Kurilin (andreykurilin)

Reviewed: https://review.openstack.org/337012
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=55201c55a8d74fc49fe8e6359d54d5b4c2303e1c
Submitter: Jenkins
Branch: master

commit 55201c55a8d74fc49fe8e6359d54d5b4c2303e1c
Author: yuyafei <email address hidden>
Date: Mon Jul 4 15:30:56 2016 +0800

    base.Resource not define __ne__() built-in function

    Class base.Resource defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it by defining __ne__() built-in function
    of class base.Resource. Also fixes spelling errors:resoruces.

    Change-Id: I39e6f6b94e9490afc14143208e6f20b0ef960991
    Closes-Bug: #1586268

Changed in python-novaclient:
status: In Progress → Fix Released
Ji.Wei (jiwei) on 2016-07-11
no longer affects: glance

Reviewed: https://review.openstack.org/337033
Committed: https://git.openstack.org/cgit/openstack/python-ceilometerclient/commit/?id=f97de95a638347993545686ac9c225d831838340
Submitter: Jenkins
Branch: master

commit f97de95a638347993545686ac9c225d831838340
Author: yuyafei <email address hidden>
Date: Mon Jul 4 16:23:12 2016 +0800

    base.Resource not define __ne__() built-in function

    Class base.Resource defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it by defining __eq__() built-in function
    of class base.Resource. Also fixes spelling errors:resoruces.

    Change-Id: I8a4e09e277a14a16105feab81ba8d07ceee5b47f
    Closes-Bug: #1586268

Changed in python-ceilometerclient:
status: In Progress → Fix Released

Fix proposed to branch: master
Review: https://review.openstack.org/342016

Changed in tempest:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/342035

Changed in ceilometer:
status: New → In Progress

Change abandoned by yuyafei (<email address hidden>) on branch: master
Review: https://review.openstack.org/337447
Reason: Jenkins-1

Ji.Wei (jiwei) on 2016-07-14
no longer affects: swift
no longer affects: python-swiftclient

This issue was fixed in the openstack/python-heatclient 1.3.0 release.

Reviewed: https://review.openstack.org/342035
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=5cebb31c09ba408baf6bdda075cd0cc2c754a388
Submitter: Jenkins
Branch: master

commit 5cebb31c09ba408baf6bdda075cd0cc2c754a388
Author: Ji-Wei <email address hidden>
Date: Thu Jul 14 17:33:11 2016 +0800

    base.Resource not define __ne__() built-in function

    Class base.Resource defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it.

    Change-Id: I819cb27664661e0b67d1e886c28432a2d1134cb0
    Closes-Bug: #1586268

Changed in ceilometer:
status: In Progress → Fix Released

This issue was fixed in the openstack/ceilometer 7.0.0.0b2 development milestone.

Fix proposed to branch: master
Review: https://review.openstack.org/343133

Changed in neutron:
status: New → In Progress

This issue was fixed in the openstack/python-novaclient 5.0.0 release.

This issue was fixed in the openstack/ceilometer 7.0.0.0b2 development milestone.

Reviewed: https://review.openstack.org/337445
Committed: https://git.openstack.org/cgit/openstack/python-smaugclient/commit/?id=7b16de4908371cad5c1544551132eac34758315f
Submitter: Jenkins
Branch: master

commit 7b16de4908371cad5c1544551132eac34758315f
Author: yuyafei <email address hidden>
Date: Tue Jul 5 15:37:56 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

    Change-Id: Iae22095146e64081f362601665284b43d0056f48
    Closes-Bug: #1586268

Changed in python-smaugclient:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/337432
Committed: https://git.openstack.org/cgit/openstack/python-congressclient/commit/?id=ec6abb3dbe49d704372b07f4fca6918fd00324fe
Submitter: Jenkins
Branch: master

commit ec6abb3dbe49d704372b07f4fca6918fd00324fe
Author: yuyafei <email address hidden>
Date: Tue Jul 5 15:12:38 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

    Change-Id: I50234892bd3dadcda533d97c03414067e06ef0f4
    Closes-Bug: #1586268

Changed in python-congressclient:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-ceilometerclient 2.5.0 release.

Can i work on this?

Changed in python-manilaclient:
assignee: yuyafei (yu-yafei) → NidhiMittalHada (nidhimittal19)
no longer affects: keystonemiddleware
no longer affects: python-keystoneclient
yuyafei (yu-yafei) wrote :
Changed in python-keystoneclient:
assignee: nobody → yuyafei (yu-yafei)
status: New → In Progress
yuyafei (yu-yafei) wrote :

Yes, NidhiMittalHada.

yuyafei (yu-yafei) on 2016-08-09
no longer affects: python-troveclient

This issue was fixed in the openstack/python-muranoclient 0.10.0 release.

Reviewed: https://review.openstack.org/337435
Committed: https://git.openstack.org/cgit/openstack/python-keystoneclient/commit/?id=ef34175095d92a117fda149ad8a2e216e3a2b78c
Submitter: Jenkins
Branch: master

commit ef34175095d92a117fda149ad8a2e216e3a2b78c
Author: yuyafei <email address hidden>
Date: Tue Jul 5 15:21:02 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__
    Also fixes spelling errors:resoruces.

    Change-Id: Iae4ce0fe84fae810711cc8c3fdb94eb9ca1d772e
    Closes-Bug: #1586268

Changed in python-keystoneclient:
status: In Progress → Fix Released

Fix proposed to branch: master
Review: https://review.openstack.org/355157

Changed in python-manilaclient:
assignee: NidhiMittalHada (nidhimittal19) → yuyafei (yu-yafei)
status: New → In Progress
Hanxi Liu (hanxi-liu) on 2016-08-23
Changed in panko:
assignee: nobody → Hanxi Liu (hanxi-liu)
Changed in gnocchi:
assignee: nobody → Hanxi Liu (hanxi-liu)

Fix proposed to branch: master
Review: https://review.openstack.org/359293

Changed in panko:
status: New → In Progress

Fix proposed to branch: master
Review: https://review.openstack.org/359321

Changed in gnocchi:
status: New → In Progress

This issue was fixed in the openstack/python-keystoneclient 3.5.0 release.

Ji.Wei (jiwei) on 2016-08-31
Changed in octavia:
assignee: nobody → Ji.Wei (jiwei)
Changed in kosmos:
assignee: nobody → Ji.Wei (jiwei)
Ji.Wei (jiwei) on 2016-08-31
Changed in taskflow:
assignee: nobody → Ji.Wei (jiwei)

Fix proposed to branch: master
Review: https://review.openstack.org/363488

Changed in taskflow:
status: New → In Progress

Reviewed: https://review.openstack.org/363488
Committed: https://git.openstack.org/cgit/openstack/taskflow/commit/?id=e26f09e0d14d7a1a763596dd8a6029237e5ce530
Submitter: Jenkins
Branch: master

commit e26f09e0d14d7a1a763596dd8a6029237e5ce530
Author: Ji-Wei <email address hidden>
Date: Wed Aug 31 18:23:25 2016 +0800

    Some classes not define __ne__() built-in function

    Some classes defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it.

    Change-Id: I3e4f213081268bad44583a63a84795d39094117f
    Closes-Bug: #1586268

Changed in taskflow:
status: In Progress → Fix Released

This issue was fixed in the openstack/python-congressclient 1.5.0 release.

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

Reviewed: https://review.openstack.org/342016
Committed: https://git.openstack.org/cgit/openstack/tempest/commit/?id=79f5efd4687224519cd22b98b4f37b2832b1aae5
Submitter: Jenkins
Branch: master

commit 79f5efd4687224519cd22b98b4f37b2832b1aae5
Author: Ji-Wei <email address hidden>
Date: Thu Jul 14 16:58:43 2016 +0800

    Class Credentials not define __ne__() built-in function

    Class Credentials defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it.

    Change-Id: I2c0d9d6202d64de57700ceb7c15db8ed3ad7e8ff
    Closes-Bug: #1586268

Changed in tempest:
status: In Progress → Fix Released
Julien Danjou (jdanjou) on 2016-09-14
no longer affects: gnocchi

Reviewed: https://review.openstack.org/359293
Committed: https://git.openstack.org/cgit/openstack/panko/commit/?id=02d16e5f70d55173089832a4284ab75dbc4376a4
Submitter: Jenkins
Branch: master

commit 02d16e5f70d55173089832a4284ab75dbc4376a4
Author: Hanxi <email address hidden>
Date: Tue Aug 23 20:48:43 2016 +0800

    Base.Model not define __ne__() built-in function

    Class base.Model defines __eq__() built-in function, but does
    not define __ne__() built-in function, so self.assertEqual works
    but self.assertNotEqual does not work at all in this test case in
    python2. This patch fixes it.

    Change-Id: I22e6b8e067638e148923e7a72aa8bfdc5f29b6df
    Closes-Bug: #1586268

Changed in panko:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/355157
Committed: https://git.openstack.org/cgit/openstack/python-manilaclient/commit/?id=ee60b3aabe1fe7de3527c2a8a18f1769d2338b7e
Submitter: Jenkins
Branch: master

commit ee60b3aabe1fe7de3527c2a8a18f1769d2338b7e
Author: yuyafei <email address hidden>
Date: Sat Aug 13 15:42:08 2016 +0800

    Add __ne__ built-in function

    In Python 3 __ne__ by default delegates to __eq__ and inverts the
    result, but in Python 2 they urge you to define __ne__ when you
    define __eq__ for it to work properly [1].There are no implied
    relationships among the comparison operators. The truth of x==y
    does not imply that x!=y is false. Accordingly, when defining
    __eq__(), one should also define __ne__() so that the operators
    will behave as expected.
    [1]https://docs.python.org/2/reference/datamodel.html#object.__ne__

    Without the change in base.py, if r1==r2, the follow code should all
    pass.
        self.assertEqual(r1, r2)
        self.assertNotEqual(r1, r2)
    The change here is for a way to self.assertNotEqual(r1, r2) as
    expected.

    Change-Id: I72485d38eab8b5a2034a621e1eebf33b86832f35
    Closes-Bug: #1586268

Changed in python-manilaclient:
status: In Progress → Fix Released
no longer affects: neutron

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

This issue was fixed in the openstack/python-keystoneclient 3.5.0 release.

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

This issue was fixed in the openstack/python-keystoneclient 3.5.0 release.

Michael Johnson (johnsom) wrote :
Changed in octavia:
importance: Undecided → Low
status: New → Fix Released

This issue was fixed in the openstack/taskflow 2.7.0 release.

Change abandoned by yuyafei (<email address hidden>) on branch: master
Review: https://review.openstack.org/337429

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

This issue was fixed in the openstack/python-congressclient 1.5.0 release.

This issue was fixed in the openstack/python-keystoneclient 3.5.0 release.

This issue was fixed in the openstack/taskflow 2.7.0 release.

This issue was fixed in the openstack/python-cinderclient 1.9.0 release.

This issue was fixed in the openstack/python-congressclient 1.5.0 release.

This issue was fixed in the openstack/python-keystoneclient 3.5.0 release.

Sean Dague (sdague) wrote :

Please never ever open bugs like this

no longer affects: nova
no longer affects: ceilometer
no longer affects: heat
no longer affects: python-novaclient
no longer affects: tempest
no longer affects: python-manilaclient
no longer affects: python-keystoneclient
no longer affects: python-heatclient
no longer affects: python-cinderclient
no longer affects: python-ceilometerclient
no longer affects: python-barbicanclient
no longer affects: horizon
no longer affects: python-glanceclient

This issue was fixed in the openstack/python-manilaclient 1.12.0 release.

This issue was fixed in the openstack/panko 2.0.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.