From cef01360b03c433145d05ed19eb21ec6e770eb5d Mon Sep 17 00:00:00 2001 From: Alexander Kabui Date: Tue, 1 Feb 2022 00:29:01 +0300 Subject: return 401 on request fail --- gn3/api/ctl.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gn3/api/ctl.py b/gn3/api/ctl.py index 05cf6ff..0844c95 100644 --- a/gn3/api/ctl.py +++ b/gn3/api/ctl.py @@ -16,9 +16,7 @@ def run_ctl(): """endpoint to run ctl""" ctl_data = request.json - results = call_ctl_script(ctl_data) - - return jsonify({ + (cmd_results, response) = call_ctl_script(ctl_data) + return (jsonify({ "results": results - }) - + }), 200) if response is not None else (jsonify({"error": str(cmd_results)}), 401) -- cgit v1.2.3