]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
manager: use self._type in KresID.__eq__()
authorOto Šťáva <oto.stava@nic.cz>
Mon, 21 Aug 2023 13:01:11 +0000 (15:01 +0200)
committerOto Šťáva <oto.stava@nic.cz>
Mon, 21 Aug 2023 13:01:11 +0000 (15:01 +0200)
Fixes a case where a GC and KRESD KresID with the same `self._id` would
be considered equal. Said behaviour breaks listing of all running
subprocesses, where `kresd0` would be missing, because it has the same
`self._id` as `cache-gc`.

manager/knot_resolver_manager/kresd_controller/interface.py

index c0d22a527c66085c840487ec3f831b63e80c1727..5a6ea5fe182d5022c88f616ed3e0070843f3c0c7 100644 (file)
@@ -72,7 +72,7 @@ class KresID:
 
     def __eq__(self, o: object) -> bool:
         if isinstance(o, KresID):
-            return self._id == o._id
+            return self._type == o._type and self._id == o._id
         return False
 
     def __str__(self) -> str: