From: Morgan Richomme Date: Fri, 12 Aug 2016 13:00:05 +0000 (+0200) Subject: copper push to DB fix X-Git-Tag: 0.2~1305^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=1a54e35fdde9f328ced7ea788f2f6daa94a9ce31;p=functest-xtesting.git copper push to DB fix JIRA: FUNCTEST-67 Change-Id: I03620f7f41f78da0ab004d55f72da88e9a30a1ea Signed-off-by: Morgan Richomme --- diff --git a/testcases/features/copper.py b/testcases/features/copper.py index 9efcbd7f..78c0fb4d 100755 --- a/testcases/features/copper.py +++ b/testcases/features/copper.py @@ -60,23 +60,29 @@ def main(): version = functest_utils.get_version(logger) build_tag = functest_utils.get_build_tag(logger) - logger.info("Pushing COPPER results: TEST_DB_URL=%(db)s pod_name=%(pod)s " - "version=%(v)s scenario=%(s)s criteria=%(c)s details=%(d)s" % { - 'db': TEST_DB_URL, - 'pod': pod_name, - 'v': version, - 's': scenario, - 'c': details['status'], - 'b': build_tag, - 'd': details, - }) - functest_utils.push_results_to_db("COPPER", - "COPPER-notification", - logger, - start_time, - stop_time, - details['status'], - details) + try: + logger.info("Pushing COPPER results: TEST_DB_URL=%(db)s " + "pod_name=%(pod)s version=%(v)s scenario=%(s)s " + "criteria=%(c)s details=%(d)s" % { + 'db': TEST_DB_URL, + 'pod': pod_name, + 'v': version, + 's': scenario, + 'c': details['status'], + 'b': build_tag, + 'd': details, + }) + functest_utils.push_results_to_db("copper", + "copper-notification", + logger, + start_time, + stop_time, + details['status'], + details) + except: + logger.error("Error pushing results into Database '%s'" + % sys.exc_info()[0]) + if ret_val != 0: sys.exit(-1)