aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2017-04-26 09:18:04 +0200
committerCédric Ollivier <cedric.ollivier@orange.com>2017-04-26 09:35:47 +0200
commitd1398b95c40dacdeb1bf03cbfff77a458ccb8235 (patch)
tree88a7182d2162f9a669a7ed86ac53ce17c5209cc8
parent37c98a6fa101be2b32129dd5d71ad750f5245b88 (diff)
Catch os.makedirs() exceptions in tempest.py
It can raise an error exception if the leaf directory already exists or cannot be created [1]. [1] https://docs.python.org/2/library/os.html JIRA: FUNCTEST-804 Change-Id: Ie410bccf1bb2dfd36df6e918c152ecf94844b5d7 Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
-rw-r--r--functest/opnfv_tests/openstack/tempest/tempest.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py
index 8fa413a8..e6c6b44f 100644
--- a/functest/opnfv_tests/openstack/tempest/tempest.py
+++ b/functest/opnfv_tests/openstack/tempest/tempest.py
@@ -208,11 +208,9 @@ class TempestCommon(testcase.TestCase):
def run(self):
self.start_time = time.time()
-
- if not os.path.exists(conf_utils.TEMPEST_RESULTS_DIR):
- os.makedirs(conf_utils.TEMPEST_RESULTS_DIR)
-
try:
+ if not os.path.exists(conf_utils.TEMPEST_RESULTS_DIR):
+ os.makedirs(conf_utils.TEMPEST_RESULTS_DIR)
image_and_flavor = conf_utils.create_tempest_resources()
conf_utils.configure_tempest(
self.DEPLOYMENT_DIR,