BB: Modify MonkeyIslandClient.import_config() to send propagation credentials to relevant endpoint

This commit is contained in:
Shreya Malviya 2022-07-21 19:45:16 +05:30 committed by Mike Salvatore
parent 379ada7a24
commit 8b43d910b6
1 changed files with 8 additions and 1 deletions

View File

@ -32,9 +32,16 @@ class MonkeyIslandClient(object):
@avoid_race_condition
def import_config(self, test_configuration: TestConfiguration):
_ = self.requests.post(
self.requests.post(
"api/agent-configuration", data=test_configuration.agent_configuration.to_json()
)
serialized_propagation_credentials = json.dumps(
[credential.to_json() for credential in test_configuration.propagation_credentials]
)
self.requests.post(
"/api/propagation-credentials/configured-credentials",
data=serialized_propagation_credentials,
)
@avoid_race_condition
def run_monkey_local(self):