From 60bc06ce24a5e6bfa6302bf1c5969e10b9e31077 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Mon, 28 Aug 2017 08:05:29 +0000 Subject: Avoid exiting when snapshot initialization failed Change-Id: Ia8162d6c64847090d94f97fdab92cad2b5f059f1 Signed-off-by: Linda Wang --- .../openstack/refstack_client/refstack_client.py | 13 ++++++++----- functest/opnfv_tests/openstack/tempest/tempest.py | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py index d4a1f0728..17e024666 100644 --- a/functest/opnfv_tests/openstack/refstack_client/refstack_client.py +++ b/functest/opnfv_tests/openstack/refstack_client/refstack_client.py @@ -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() diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index c7ad4df2f..6523dfca4 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -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() -- cgit 1.2.3-korg