diff options
author | 2016-06-13 14:55:24 +0200 | |
---|---|---|
committer | 2016-06-13 14:55:24 +0200 | |
commit | 78dc8149929ba2ba9dc961a73a0b4b8638ad7610 (patch) | |
tree | 6ee96db1037635800cd784f88906d07619019ce3 /utils/functest_utils.py | |
parent | 8111a1371e4221d0224b388e5896ce29c8d7e7e0 (diff) |
Fix bug: use right format for date when pushing to DB
JIRA: FUNCTEST-303
Change-Id: I53e7c8f963ef0fa248d76e0d1c5f04326a750dcc
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
Diffstat (limited to 'utils/functest_utils.py')
-rw-r--r-- | utils/functest_utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/utils/functest_utils.py b/utils/functest_utils.py index 7b682442..2e7a1223 100644 --- a/utils/functest_utils.py +++ b/utils/functest_utils.py @@ -8,6 +8,7 @@ # http://www.apache.org/licenses/LICENSE-2.0 # +from datetime import datetime as dt import json import os import os.path @@ -172,12 +173,14 @@ def push_results_to_db(project, case_name, logger, version = get_version(logger) pod_name = get_pod_name(logger) build_tag = get_build_tag(logger) + test_start = dt.fromtimestamp(start_date).strftime('%Y-%m-%d %H:%M:%S') + test_stop = dt.fromtimestamp(stop_date).strftime('%Y-%m-%d %H:%M:%S') params = {"project_name": project, "case_name": case_name, "pod_name": pod_name, "installer": installer, "version": version, "scenario": scenario, "criteria": criteria, - "build_tag": build_tag, "start_date": start_date, - "stop_date": stop_date, "details": details} + "build_tag": build_tag, "start_date": test_start, + "stop_date": test_stop, "details": details} headers = {'Content-Type': 'application/json'} try: |