forked from p15670423/monkey
Agent: Reimplement HTTPIslandAPIClient.send_log() as member, not static
This commit is contained in:
parent
aba342b3f2
commit
92da3b78db
|
@ -78,7 +78,7 @@ class ControlClient:
|
|||
return
|
||||
try:
|
||||
telemetry = {"monkey_guid": GUID, "log": json.dumps(log)}
|
||||
HTTPIslandAPIClient.send_log(self.server_address, json.dumps(telemetry))
|
||||
self._island_api_client.send_log(json.dumps(telemetry))
|
||||
except Exception as exc:
|
||||
logger.warning(f"Error connecting to control server {self.server_address}: {exc}")
|
||||
|
||||
|
|
|
@ -38,12 +38,13 @@ class HTTPIslandAPIClient(IIslandAPIClient):
|
|||
timeout=MEDIUM_REQUEST_TIMEOUT,
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
self._island_server = island_server
|
||||
|
||||
@handle_island_errors
|
||||
def send_log(server_address: str, data: str):
|
||||
def send_log(self, log_contents: str):
|
||||
requests.post( # noqa: DUO123
|
||||
"https://%s/api/log" % (server_address,),
|
||||
json=data,
|
||||
f"https://{self._island_server}/api/log",
|
||||
json=log_contents,
|
||||
verify=False,
|
||||
timeout=MEDIUM_REQUEST_TIMEOUT,
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue