Agent: Fix mypy errors in monkey.py

This commit is contained in:
Kekoa Kaaikala 2022-09-21 17:09:06 +00:00
parent 4f04cf1c18
commit 60c1eb9cc1
1 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ class InfectionMonkey:
return opts return opts
# TODO: By the time we finish 2292, _connect_to_island_api() may not need to return `server` # TODO: By the time we finish 2292, _connect_to_island_api() may not need to return `server`
def _connect_to_island_api(self) -> Tuple[str, IIslandAPIClient]: def _connect_to_island_api(self) -> Tuple[Optional[str], Optional[IIslandAPIClient]]:
logger.debug(f"Trying to wake up with servers: {', '.join(self._opts.servers)}") logger.debug(f"Trying to wake up with servers: {', '.join(self._opts.servers)}")
server_clients = find_available_island_apis( server_clients = find_available_island_apis(
self._opts.servers, HTTPIslandAPIClientFactory(self._agent_event_serializer_registry) self._opts.servers, HTTPIslandAPIClientFactory(self._agent_event_serializer_registry)
@ -166,7 +166,7 @@ class InfectionMonkey:
return server, island_api_client return server, island_api_client
def _select_server( def _select_server(
self, server_clients: Mapping[str, IIslandAPIClient] self, server_clients: Mapping[str, Optional[IIslandAPIClient]]
) -> Tuple[Optional[str], Optional[IIslandAPIClient]]: ) -> Tuple[Optional[str], Optional[IIslandAPIClient]]:
for server in self._opts.servers: for server in self._opts.servers:
if server_clients[server]: if server_clients[server]: