Avoid exiting when snapshot initialization failed 47/40347/3
authorLinda Wang <wangwulin@huawei.com>
Mon, 28 Aug 2017 08:05:29 +0000 (08:05 +0000)
committerLinda Wang <wangwulin@huawei.com>
Mon, 28 Aug 2017 10:15:09 +0000 (10:15 +0000)
Change-Id: Ia8162d6c64847090d94f97fdab92cad2b5f059f1
Signed-off-by: Linda Wang <wangwulin@huawei.com>
functest/opnfv_tests/openstack/refstack_client/refstack_client.py
functest/opnfv_tests/openstack/tempest/tempest.py

index d4a1f07..17e0246 100644 (file)
@@ -224,11 +224,14 @@ class RefstackClient(testcase.TestCase):
         if not self.tempestconf:
             self.generate_conf()
 
-        os_utils.init_tempest_cleanup(
-            self.tempestconf.DEPLOYMENT_DIR, 'tempest.conf',
-            os.path.join(conf_utils.REFSTACK_RESULTS_DIR,
-                         "tempest-cleanup-init.log")
-        )
+        try:
+            os_utils.init_tempest_cleanup(
+                self.tempestconf.DEPLOYMENT_DIR, 'tempest.conf',
+                os.path.join(conf_utils.REFSTACK_RESULTS_DIR,
+                             "tempest-cleanup-init.log"))
+        except Exception as err:
+            LOGGER.error(str(err))
+            return testcase.TestCase.EX_RUN_ERROR
 
         return super(RefstackClient, self).create_snapshot()
 
index c7ad4df..6523dfc 100644 (file)
@@ -267,11 +267,14 @@ class TempestCommon(testcase.TestCase):
         # Make sure that the verifier is configured
         conf_utils.configure_verifier(self.DEPLOYMENT_DIR)
 
-        os_utils.init_tempest_cleanup(
-            self.DEPLOYMENT_DIR, 'tempest.conf',
-            os.path.join(conf_utils.TEMPEST_RESULTS_DIR,
-                         "tempest-cleanup-init.log")
-        )
+        try:
+            os_utils.init_tempest_cleanup(
+                self.DEPLOYMENT_DIR, 'tempest.conf',
+                os.path.join(conf_utils.TEMPEST_RESULTS_DIR,
+                             "tempest-cleanup-init.log"))
+        except Exception as err:
+            logger.error(str(err))
+            return testcase.TestCase.EX_RUN_ERROR
 
         return super(TempestCommon, self).create_snapshot()