From cdec949920eb3313a36e0322320af2bdb30757a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Pirkl?= <pirkl.theo@gmail.com> Date: Wed, 12 Aug 2020 16:10:14 +0200 Subject: [PATCH] Adds flexibility to HTTP communications --- projet/agent/src/common/schnell/workers.py | 4 ++-- projet/agent/src/server/api/PlaybookAPI.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/projet/agent/src/common/schnell/workers.py b/projet/agent/src/common/schnell/workers.py index d3ce0df..fab2dd9 100644 --- a/projet/agent/src/common/schnell/workers.py +++ b/projet/agent/src/common/schnell/workers.py @@ -19,13 +19,13 @@ def work(data): tasks = data['tasks'] try: Runner(tasks, wargs).run() - requests.post(url="https://" + env('SERVER_WEB_FQDN') + "/api/job/" + str(wid) + "/finished" + requests.post(url="http://" + env('SERVER_WEB_FQDN') + "/api/job/" + str(wid) + "/finished" , verify=False) except Exception as e: logger.error("Stopped workflow because of an error.") logger.error(e) try: - requests.post(url="https://" + env('SERVER_WEB_FQDN') + "/api/job/" + str(wid) + "/failed" + requests.post(url="http://" + env('SERVER_WEB_FQDN') + "/api/job/" + str(wid) + "/failed" , verify=False) except Exception as e: pass diff --git a/projet/agent/src/server/api/PlaybookAPI.py b/projet/agent/src/server/api/PlaybookAPI.py index 52825c8..fec1ca2 100644 --- a/projet/agent/src/server/api/PlaybookAPI.py +++ b/projet/agent/src/server/api/PlaybookAPI.py @@ -51,7 +51,7 @@ def compute_response(playbookData): # Runs a playbook given in argument def run_playbook(arguments, clientsTasks, clientID): - serverPayload = requests.get(url="https://" + env('SERVER_WEB_FQDN') + "/api/client/" + clientID, + serverPayload = requests.get(url="http://" + env('SERVER_WEB_FQDN') + "/api/client/" + clientID, verify=False, headers={'Accept': 'application/json'}) if serverPayload.status_code != 200: -- GitLab