From 5c60656f560a49063742d428964aca47bcc8efea Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Fri, 22 Jul 2022 12:34:28 -0400 Subject: [PATCH] BB: Rename post_json(data) parameter to json --- .../monkey_zoo/blackbox/island_client/monkey_island_client.py | 4 ++-- .../blackbox/island_client/monkey_island_requests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py index b687890b0..fe9a5fd89 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_client.py @@ -47,7 +47,7 @@ class MonkeyIslandClient(object): @avoid_race_condition def run_monkey_local(self): - response = self.requests.post_json("api/local-monkey", data={"action": "run"}) + response = self.requests.post_json("api/local-monkey", json={"action": "run"}) if MonkeyIslandClient.monkey_ran_successfully(response): LOGGER.info("Running the monkey.") else: @@ -61,7 +61,7 @@ class MonkeyIslandClient(object): @avoid_race_condition def kill_all_monkeys(self): response = self.requests.post_json( - "api/monkey-control/stop-all-agents", data={"kill_time": time.time()} + "api/monkey-control/stop-all-agents", json={"kill_time": time.time()} ) if response.ok: LOGGER.info("Killing all monkeys after the test.") diff --git a/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py b/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py index be2f247c3..ff3b32e92 100644 --- a/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py +++ b/envs/monkey_zoo/blackbox/island_client/monkey_island_requests.py @@ -83,9 +83,9 @@ class MonkeyIslandRequests(object): ) @_Decorators.refresh_jwt_token - def post_json(self, url, data: Dict): + def post_json(self, url, json: Dict): return requests.post( # noqa: DUO123 - self.addr + url, json=data, headers=self.get_jwt_header(), verify=False + self.addr + url, json=json, headers=self.get_jwt_header(), verify=False ) @_Decorators.refresh_jwt_token