diff options
author | Georg Kunz <georg.kunz@ericsson.com> | 2018-07-26 23:32:54 +0200 |
---|---|---|
committer | Georg Kunz <georg.kunz@ericsson.com> | 2018-07-27 14:32:03 +0200 |
commit | 4a7221beef916ffddf6404711a4283276d3e62af (patch) | |
tree | fedc03bbcb5b3cb2864b44e5b68adc3ecf09fad7 /opnfv_testapi | |
parent | 635f8b72b7ff629b32ba8b66b33cf3424c6f6868 (diff) |
Showing OVP version on "my results" page
Adding an "OVP Version" column to the "my results" page.
JIRA: DOVETAIL-708
Change-Id: Id9a9228002f3be88fda8c71aedf2f5abe24d833d
Signed-off-by: Georg Kunz <georg.kunz@ericsson.com>
Diffstat (limited to 'opnfv_testapi')
-rw-r--r-- | opnfv_testapi/resources/result_handlers.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/opnfv_testapi/resources/result_handlers.py b/opnfv_testapi/resources/result_handlers.py index 2e65ba4..1f6ec73 100644 --- a/opnfv_testapi/resources/result_handlers.py +++ b/opnfv_testapi/resources/result_handlers.py @@ -256,10 +256,18 @@ class ResultsUploadHandler(ResultsCLHandler): return results = results.split('\n') result_ids = [] + version = '' for result in results: if result == '': continue self.json_args = json.loads(result).copy() + # the result files used in the first release of OVP did not + # specify an OVP version + if (self.json_args['version'] == 'master' or + self.json_args['version'] == 'unknown'): + version = '2018.01' + else: + version = self.json_args['version'] build_tag = self.json_args['build_tag'] _id = yield self._inner_create() result_ids.append(str(_id)) @@ -269,7 +277,7 @@ class ResultsUploadHandler(ResultsCLHandler): log_filename = "/home/testapi/logs/log_%s.tar.gz" % (test_id) with open(log_filename, "wb") as tar_out: tar_out.write(fileinfo['body']) - resp = {'id': test_id, 'results': result_ids} + resp = {'id': test_id, 'results': result_ids, 'version': version} self.finish_request(resp) |