diff --git a/cinder/objects/base.py b/cinder/objects/base.py index 76a5de2b2..af7054995 100644 --- a/cinder/objects/base.py +++ b/cinder/objects/base.py @@ -428,6 +428,9 @@ class CinderComparableObject(base.ComparableVersionedObject): return self.obj_to_primitive() == obj.obj_to_primitive() return False + def __ne__(self, other): + return not self.__eq__(other) + class ObjectListBase(base.ObjectListBase): def obj_make_compatible(self, primitive, target_version): diff --git a/cinder/tests/unit/test_hpe3par.py b/cinder/tests/unit/test_hpe3par.py index 83b87e811..05ffa73a2 100644 --- a/cinder/tests/unit/test_hpe3par.py +++ b/cinder/tests/unit/test_hpe3par.py @@ -87,6 +87,9 @@ class Comment(object): def __eq__(self, actual): return (dict(ast.literal_eval(actual)) == self.expected) + def __ne__(self, other): + return not self.__eq__(other) + class HPE3PARBaseDriver(object): diff --git a/cinder/volume/drivers/netapp/dataontap/client/api.py b/cinder/volume/drivers/netapp/dataontap/client/api.py index 74da9c8e6..8ce048cdd 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/api.py +++ b/cinder/volume/drivers/netapp/dataontap/client/api.py @@ -403,6 +403,9 @@ class NaElement(object): def __eq__(self, other): return str(self) == str(other) + def __ne__(self, other): + return not self.__eq__(other) + def __hash__(self): return hash(str(self))