This commit fixes up the commit 7d42aecb, which added __eq__ without
adding __hash__ and left some copy-paste error.

Signed-off-by: IWAMOTO Toshihiro <[email protected]>
---
 ryu/lib/packet/bgp.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py
index 2fb51e8..96746f5 100644
--- a/ryu/lib/packet/bgp.py
+++ b/ryu/lib/packet/bgp.py
@@ -1095,7 +1095,9 @@ class RouteTargetMembershipNLRI(StringifyMixin):
     def __eq__(self, other):
         return ((self.origin_as, self.route_target) ==
                 (other.origin_as, other.route_target))
-        return (self.afi, self.safi) == (other.afi, other.safi)
+
+    def __hash__(self):
+        return hash((self.origin_as, self.route_target))
 
     @classmethod
     def parser(cls, buf):
-- 
2.1.4


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel

Reply via email to