forked from p15670423/monkey
Agent: Use HTTPIslandAPIClient in find_server
This commit is contained in:
parent
787af6ae1b
commit
f4b47f8238
|
@ -5,13 +5,13 @@ from ipaddress import IPv4Address
|
|||
from typing import Dict, Iterable, Iterator, MutableMapping, Optional
|
||||
|
||||
from common.network.network_utils import address_to_ip_port
|
||||
from infection_monkey.network.relay import RELAY_CONTROL_MESSAGE_REMOVE_FROM_WAITLIST
|
||||
from infection_monkey.transport import (
|
||||
IslandAPIClient,
|
||||
from infection_monkey.island_api_client import (
|
||||
HTTPIslandAPIClient,
|
||||
IslandAPIConnectionError,
|
||||
IslandAPIError,
|
||||
IslandAPITimeoutError,
|
||||
)
|
||||
from infection_monkey.network.relay import RELAY_CONTROL_MESSAGE_REMOVE_FROM_WAITLIST
|
||||
from infection_monkey.utils.threading import (
|
||||
ThreadSafeIterator,
|
||||
create_daemon_thread,
|
||||
|
@ -54,7 +54,7 @@ def _check_if_island_server(server: str) -> bool:
|
|||
logger.debug(f"Trying to connect to server: {server}")
|
||||
|
||||
try:
|
||||
IslandAPIClient(server)
|
||||
HTTPIslandAPIClient(server)
|
||||
|
||||
return True
|
||||
except IslandAPIConnectionError as err:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import pytest
|
||||
import requests_mock
|
||||
|
||||
from infection_monkey.island_api_client import IslandAPIConnectionError
|
||||
from infection_monkey.network.relay.utils import find_server
|
||||
from infection_monkey.transport import IslandAPIConnectionError
|
||||
|
||||
SERVER_1 = "1.1.1.1:12312"
|
||||
SERVER_2 = "2.2.2.2:4321"
|
||||
|
|
Loading…
Reference in New Issue