From 7a7ea96dbb64d01af20140c13580796d8d7dd744 Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Tue, 6 Sep 2022 12:27:07 +0000 Subject: [PATCH] Agent: Set daemon thread in superclass constructor --- monkey/infection_monkey/network/relay/sockets_pipe.py | 3 +-- monkey/infection_monkey/tcp_relay.py | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/monkey/infection_monkey/network/relay/sockets_pipe.py b/monkey/infection_monkey/network/relay/sockets_pipe.py index 14e0848da..3749c6c57 100644 --- a/monkey/infection_monkey/network/relay/sockets_pipe.py +++ b/monkey/infection_monkey/network/relay/sockets_pipe.py @@ -23,8 +23,7 @@ class SocketsPipe(Thread): self.dest = dest self.timeout = timeout self._keep_connection = True - super().__init__(name=f"SocketsPipeThread-{self.ident}") - self.daemon = True + super().__init__(name=f"SocketsPipeThread-{self.ident}", daemon=True) self._client_disconnected = client_disconnected def run(self): diff --git a/monkey/infection_monkey/tcp_relay.py b/monkey/infection_monkey/tcp_relay.py index 7f8a9abe5..a79adf334 100644 --- a/monkey/infection_monkey/tcp_relay.py +++ b/monkey/infection_monkey/tcp_relay.py @@ -20,8 +20,7 @@ class TCPRelay(Thread): self._user_handler = relay_user_handler self._connection_handler = connection_handler self._pipe_spawner = pipe_spawner - super().__init__(name="MonkeyTcpRelayThread") - self.daemon = True + super().__init__(name="MonkeyTcpRelayThread", daemon=True) self._lock = Lock() def run(self):