diff options
author | Chris Donley <christopher.donley@huawei.com> | 2018-03-16 14:16:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2018-03-16 14:16:45 +0000 |
commit | 1c473e186f58b2211e4658a472fc7dced7ec2f64 (patch) | |
tree | ac1ca80e07e1bf2bdffb79d26c37931348dd297a /ice-server/heat_test/heat_validator.py | |
parent | 2fab7d685ff579f1fa00013fe268a9a2bed03e5f (diff) | |
parent | b071b23b024a07b5e0d9f1c915468384369e26af (diff) |
Merge "Dockerize rest API for ICE tests"
Diffstat (limited to 'ice-server/heat_test/heat_validator.py')
-rw-r--r-- | ice-server/heat_test/heat_validator.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ice-server/heat_test/heat_validator.py b/ice-server/heat_test/heat_validator.py index 0cc32a1..d76d275 100644 --- a/ice-server/heat_test/heat_validator.py +++ b/ice-server/heat_test/heat_validator.py @@ -7,7 +7,7 @@ import zipfile from io import StringIO import pytest -from flask import (request, jsonify, abort) +from flask import (request, jsonify, abort, current_app) class HeatValidator(object): @@ -49,7 +49,8 @@ class HeatValidator(object): original_output = sys.stdout # Assign StringIO so the output is not sent anymore to the console sys.stdout = StringIO() - exit_code = pytest.main(['../../validation-scripts/ice_validator', + script_path = current_app.config['ICE_SCRIPT_PATH'] + exit_code = pytest.main([script_path, '--resultlog=' + tmp_dir + '/result.txt', '--template-dir', tmp_dir]) with open(tmp_dir + '/result.txt', 'r') as result_file: @@ -62,7 +63,7 @@ class HeatValidator(object): except zipfile.BadZipFile: logging.exception("invalid file") abort(422, {'status': 4, 'message': 'invalid file'}) - except: + except Exception as e: logging.exception("server error on file") abort(500, {'status': 3, 'message': 'server error'}) finally: |