Skip to content
Snippets Groups Projects
Verified Commit cdec9499 authored by Théo Pirkl's avatar Théo Pirkl :nail_care:
Browse files

Adds flexibility to HTTP communications

parent 39723d52
Branches
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment