diff --git a/MC/bin/o2_dpg_workflow_runner.py b/MC/bin/o2_dpg_workflow_runner.py index 229125c3c..576d2d23a 100755 --- a/MC/bin/o2_dpg_workflow_runner.py +++ b/MC/bin/o2_dpg_workflow_runner.py @@ -110,8 +110,10 @@ def setup_logger(name, log_file, level=logging.INFO): # TODO: integrate into standard logger def send_webhook(hook, t): if hook!=None: - command="curl -X POST -H 'Content-type: application/json' --data '{\"text\":\" " + str(t) + "\"}' " + str(hook) + " &> /dev/null" - os.system(command) + import json + data = json.dumps({"text": " " + str(t)}) + subprocess.run(["curl", "-X", "POST", "-H", "Content-type: application/json", "--data", data, str(hook)], + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) # A fallback solution to getting all child procs # in case psutil has problems (PermissionError).