copper push to DB fix 49/18549/1
authorMorgan Richomme <morgan.richomme@orange.com>
Fri, 12 Aug 2016 13:00:05 +0000 (15:00 +0200)
committerMorgan Richomme <morgan.richomme@orange.com>
Fri, 12 Aug 2016 13:00:05 +0000 (15:00 +0200)
JIRA: FUNCTEST-67

Change-Id: I03620f7f41f78da0ab004d55f72da88e9a30a1ea
Signed-off-by: Morgan Richomme <morgan.richomme@orange.com>
testcases/features/copper.py

index 9efcbd7..78c0fb4 100755 (executable)
@@ -60,23 +60,29 @@ def main():
     version = functest_utils.get_version(logger)\r
     build_tag = functest_utils.get_build_tag(logger)\r
 \r
-    logger.info("Pushing COPPER results: TEST_DB_URL=%(db)s pod_name=%(pod)s "\r
-                "version=%(v)s scenario=%(s)s criteria=%(c)s details=%(d)s" % {\r
-                    'db': TEST_DB_URL,\r
-                    'pod': pod_name,\r
-                    'v': version,\r
-                    's': scenario,\r
-                    'c': details['status'],\r
-                    'b': build_tag,\r
-                    'd': details,\r
-                })\r
-    functest_utils.push_results_to_db("COPPER",\r
-                                      "COPPER-notification",\r
-                                      logger,\r
-                                      start_time,\r
-                                      stop_time,\r
-                                      details['status'],\r
-                                      details)\r
+    try:\r
+        logger.info("Pushing COPPER results: TEST_DB_URL=%(db)s "\r
+                    "pod_name=%(pod)s version=%(v)s scenario=%(s)s "\r
+                    "criteria=%(c)s details=%(d)s" % {\r
+                        'db': TEST_DB_URL,\r
+                        'pod': pod_name,\r
+                        'v': version,\r
+                        's': scenario,\r
+                        'c': details['status'],\r
+                        'b': build_tag,\r
+                        'd': details,\r
+                    })\r
+        functest_utils.push_results_to_db("copper",\r
+                                          "copper-notification",\r
+                                          logger,\r
+                                          start_time,\r
+                                          stop_time,\r
+                                          details['status'],\r
+                                          details)\r
+    except:\r
+        logger.error("Error pushing results into Database '%s'"\r
+                     % sys.exc_info()[0])\r
+\r
     if ret_val != 0:\r
         sys.exit(-1)\r
 \r