-
Notifications
You must be signed in to change notification settings - Fork 807
Closed
Labels
BugAn error, flaw, misbehavior or failure in the Monkey or Monkey Island.An error, flaw, misbehavior or failure in the Monkey or Monkey Island.Complexity: LowImpact: Lowsp/1
Milestone
Description
Description
It appears that sometimes exploiter order may not be preserved
diff --git a/monkey/infection_monkey/island_api_client/http_island_api_client.py b/monkey/infection_monkey/island_api_client/http_island_api_client.py
index c044cf664..4c36c3fd8 100644
--- a/monkey/infection_monkey/island_api_client/http_island_api_client.py
+++ b/monkey/infection_monkey/island_api_client/http_island_api_client.py
@@ -96,9 +96,13 @@ class HTTPIslandAPIClient(IIslandAPIClient):
response = self.http_client.get("agent-configuration", timeout=SHORT_REQUEST_TIMEOUT)
config_dict = response.json()
- logger.debug(f"Received configuration:\n{pformat(config_dict)}")
+ logger.debug(f"Raw JSON configuration:\n{pformat(config_dict)}")
+
+ agent_configuration = AgentConfiguration(**config_dict)
+ logger.debug(f"Received config {agent_configuration}")
+
+ return agent_configuration
- return AgentConfiguration(**config_dict)
@handle_response_parsing_errors
def get_credentials_for_propagation(self) -> Sequence[Credentials]:
Update:
Order is preserved. This is simply a matter of display, but that can't be resolved until we upgrade to Python3.8. See 6ef9179.
A unit test was added in 09c7540 to ensure that order is preserved.
Tasks
- Fix it (0.25d) @mssalvatore
- Change
pformat()
call to not sort dictionaries - Add back in (or improve) the unit test from 09c7540
- Change
Metadata
Metadata
Assignees
Labels
BugAn error, flaw, misbehavior or failure in the Monkey or Monkey Island.An error, flaw, misbehavior or failure in the Monkey or Monkey Island.Complexity: LowImpact: Lowsp/1