aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/tempest/conf_utils.py
diff options
context:
space:
mode:
authorJuha Kosonen <juha.kosonen@nokia.com>2018-09-07 13:54:38 +0300
committerJuha Kosonen <juha.kosonen@nokia.com>2018-09-07 14:52:08 +0300
commit101000ae41d7391c4fa10f65835cffc72ad9f543 (patch)
tree4b49518ed6400b42c62b7e9596ee342ba234165b /functest/opnfv_tests/openstack/tempest/conf_utils.py
parent98f3bf16722e5e718130f960910d64bc76951e3b (diff)
Do not raise exceptions in conf_utils
Return a reasonable value for caller to process. Change-Id: I5a83544aaebb4e53db37ddaa13033d77848722b8 Signed-off-by: Juha Kosonen <juha.kosonen@nokia.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/tempest/conf_utils.py')
-rw-r--r--functest/opnfv_tests/openstack/tempest/conf_utils.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py
index 80f78e979..d3f7a7b1f 100644
--- a/functest/opnfv_tests/openstack/tempest/conf_utils.py
+++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py
@@ -81,6 +81,7 @@ def create_rally_deployment(environ=None):
cmd = ['rally', 'deployment', 'check']
output = subprocess.check_output(cmd)
LOGGER.info("%s\n%s", " ".join(cmd), output)
+ return get_verifier_deployment_id()
def create_verifier():
@@ -101,6 +102,7 @@ def create_verifier():
'--type', 'tempest', '--system-wide']
output = subprocess.check_output(cmd)
LOGGER.info("%s\n%s", " ".join(cmd), output)
+ return get_verifier_id()
def get_verifier_id():
@@ -114,9 +116,6 @@ def get_verifier_id():
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
verifier_uuid = proc.stdout.readline().rstrip()
- if verifier_uuid == "":
- LOGGER.error("Tempest verifier not found.")
- raise Exception('Error with command:%s' % cmd)
return verifier_uuid
@@ -131,9 +130,6 @@ def get_verifier_deployment_id():
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
deployment_uuid = proc.stdout.readline().rstrip()
- if deployment_uuid == "":
- LOGGER.error("Rally deployment not found.")
- raise Exception('Error with command:%s' % cmd)
return deployment_uuid
@@ -261,10 +257,8 @@ def configure_verifier(deployment_dir):
if not os.path.isfile(tempest_conf_file):
LOGGER.error("Tempest configuration file %s NOT found.",
tempest_conf_file)
- raise Exception("Tempest configuration file %s NOT found."
- % tempest_conf_file)
- else:
- return tempest_conf_file
+ return None
+ return tempest_conf_file
def convert_dict_to_ini(value):