diff --git a/astara/api/neutron.py b/astara/api/neutron.py index ad1cf09d..4c5683d5 100644 --- a/astara/api/neutron.py +++ b/astara/api/neutron.py @@ -362,6 +362,9 @@ class Port(DictModelBase): def __eq__(self, other): return type(self) == type(other) and vars(self) == vars(other) + def __ne__(self, other): + return not self.__eq__(other) + @property def first_v4(self): for fixed_ip in self.fixed_ips: @@ -396,6 +399,9 @@ class FixedIp(DictModelBase): def __eq__(self, other): return type(self) == type(other) and vars(self) == vars(other) + def __ne__(self, other): + return not self.__eq__(other) + @classmethod def from_dict(cls, d): return cls(d['subnet_id'], d['ip_address']) diff --git a/astara/common/linux/ip_lib.py b/astara/common/linux/ip_lib.py index 51bcc600..97eff543 100644 --- a/astara/common/linux/ip_lib.py +++ b/astara/common/linux/ip_lib.py @@ -160,6 +160,9 @@ class IPDevice(SubProcessBase): return (other is not None and self.name == other.name and self.namespace == other.namespace) + def __ne__(self, other): + return not self.__eq__(other) + def __str__(self): return self.name diff --git a/astara/test/unit/test_debug.py b/astara/test/unit/test_debug.py index 794719e1..83becfc5 100644 --- a/astara/test/unit/test_debug.py +++ b/astara/test/unit/test_debug.py @@ -62,6 +62,9 @@ class TestDebug(base.RugTestBase): def __eq__(self, other): return self.crud == other.crud + def __ne__(self, other): + return not self.__eq__(other) + automaton.return_value.send_message.assert_called_once_with( CrudMatch('update') )