Agent: Fix log call exhausting iterator

This commit is contained in:
Kekoa Kaaikala 2022-09-08 15:55:50 +00:00 committed by Mike Salvatore
parent 2fadfd1b31
commit 6051cfa29a
2 changed files with 1 additions and 2 deletions

View File

@ -126,6 +126,7 @@ class InfectionMonkey:
return opts return opts
def _get_server(self): def _get_server(self):
logger.debug(f"Trying to wake up with servers: {', '.join(self._opts.servers)}")
servers_iterator = (s for s in self._opts.servers) servers_iterator = (s for s in self._opts.servers)
server = find_server(servers_iterator) server = find_server(servers_iterator)
if server: if server:

View File

@ -14,8 +14,6 @@ logger = logging.getLogger(__name__)
def find_server(servers: Iterable[str]) -> Optional[str]: def find_server(servers: Iterable[str]) -> Optional[str]:
logger.debug(f"Trying to wake up with servers: {', '.join(servers)}")
for server in servers: for server in servers:
logger.debug(f"Trying to connect to server: {server}") logger.debug(f"Trying to connect to server: {server}")