forked from p34709852/monkey
BB: Rename post_json(data) parameter to json
This commit is contained in:
parent
2d338fc81f
commit
5c60656f56
|
@ -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.")
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue