diff options
author | xudan <xudan16@huawei.com> | 2019-10-24 04:04:10 -0400 |
---|---|---|
committer | xudan <xudan16@huawei.com> | 2019-10-25 03:46:11 -0400 |
commit | 01bca75cc4af1665918a04c2a9a8c36dfb473d77 (patch) | |
tree | ce63f67cc0fda2ab726db432d086394d137a03c4 /dovetail/api/app/routes.py | |
parent | bfc54b0a88126c51b667fcd83d56233009c5d07e (diff) |
Update API to python3 and add some addtional APIs
Update the unit test case to fix the py27 failure.
Change-Id: Ic75b8fc037c320ec5599eb007dcee43788e32807
Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to 'dovetail/api/app/routes.py')
-rw-r--r-- | dovetail/api/app/routes.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/dovetail/api/app/routes.py b/dovetail/api/app/routes.py index b1557b67..e60f10a5 100644 --- a/dovetail/api/app/routes.py +++ b/dovetail/api/app/routes.py @@ -9,7 +9,7 @@ import uuid from flask import Flask, jsonify, request from flask_cors import CORS -import server +import app.server as server app = Flask(__name__) CORS(app) @@ -51,9 +51,10 @@ def run_testcases(): os.pardir, os.pardir)) run_script = os.path.join(repo_dir, 'run.py') - cmd = 'python {} {}'.format(run_script, input_str) + cmd = 'python3 {} {}'.format(run_script, input_str) api_home = os.path.join(dovetail_home, str(requestId)) - subprocess.Popen(cmd, shell=True, env={'DOVETAIL_HOME': api_home}) + subprocess.Popen(cmd, shell=True, env={'DOVETAIL_HOME': api_home, + 'LC_ALL': 'C.UTF-8', 'LANG': 'C.UTF-8'}) testcases_file = os.path.join(dovetail_home, str(requestId), 'results', 'testcases.json') @@ -72,7 +73,7 @@ def run_testcases(): testsuite = data['testsuite'] result = server.get_execution_status(dovetail_home, testsuite, - testcases, requestId) + testcases, testcases, requestId) return jsonify({'result': result}), 200 |