diff options
author | Jenkins <jenkins@review.openstack.org> | 2016-07-09 12:17:59 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2016-07-09 12:17:59 +0000 |
commit | fbd6708d77a69e4fe50873fb2056ed95d007dc8b (patch) | |
tree | 19104580d344ea868064ed7374792c21462cb0e3 | |
parent | dbaf9790c5f58ad8bdcec8bb9b99b53a85692436 (diff) | |
parent | 55201c55a8d74fc49fe8e6359d54d5b4c2303e1c (diff) | |
download | python-novaclient-fbd6708d77a69e4fe50873fb2056ed95d007dc8b.tar.gz |
Merge "base.Resource not define __ne__() built-in function"
-rw-r--r-- | novaclient/base.py | 3 | ||||
-rw-r--r-- | novaclient/tests/unit/test_base.py | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/novaclient/base.py b/novaclient/base.py index 0200332d..6ef27168 100644 --- a/novaclient/base.py +++ b/novaclient/base.py @@ -209,6 +209,9 @@ class Resource(RequestIdMixin): return self.id == other.id return self._info == other._info + def __ne__(self, other): + return not self.__eq__(other) + def is_loaded(self): return self._loaded diff --git a/novaclient/tests/unit/test_base.py b/novaclient/tests/unit/test_base.py index 9fa75364..a24636ca 100644 --- a/novaclient/tests/unit/test_base.py +++ b/novaclient/tests/unit/test_base.py @@ -63,7 +63,7 @@ class BaseTest(utils.TestCase): r2 = base.Resource(None, {'id': 1, 'name': 'hello'}) self.assertEqual(r1, r2) - # Two resoruces of different types: never equal + # Two resources of different types: never equal r1 = base.Resource(None, {'id': 1}) r2 = flavors.Flavor(None, {'id': 1}) self.assertNotEqual(r1, r2) |