aboutsummaryrefslogtreecommitdiffstats
path: root/testcases/vIMS/CI/orchestrator.py
diff options
context:
space:
mode:
authorboucherv <valentin.boucher@orange.com>2016-01-28 16:30:47 +0100
committervalentin boucher <valentin.boucher@orange.com>2016-01-29 10:26:47 +0000
commit88b5022795d071a3607133bf534bf5d43d1c9514 (patch)
treefb5155eb3b8822330ce61ad2dfe8c37abd372977 /testcases/vIMS/CI/orchestrator.py
parent320f9f42da31e25a41e9b7fad467394a1179a06c (diff)
Add some error result in result db api
Change-Id: I1c5f9bc51c04e321ace8c0ee0312be28d321910f Signed-off-by: boucherv <valentin.boucher@orange.com> (cherry picked from commit 9ec86196a8e96fea966beef08c01b9c9822a9bc4)
Diffstat (limited to 'testcases/vIMS/CI/orchestrator.py')
-rw-r--r--testcases/vIMS/CI/orchestrator.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/testcases/vIMS/CI/orchestrator.py b/testcases/vIMS/CI/orchestrator.py
index 382fbd139..965c2646d 100644
--- a/testcases/vIMS/CI/orchestrator.py
+++ b/testcases/vIMS/CI/orchestrator.py
@@ -106,7 +106,9 @@ class orchestrator:
script += "pip install -r requirements.txt; "
script += "timeout 1800 cfy bootstrap --install-plugins -p openstack-manager-blueprint.yaml -i inputs.yaml; "
cmd = "/bin/bash -c '" + script + "'"
- execute_command(cmd, self.logger)
+ error = execute_command(cmd, self.logger)
+ if error:
+ return error
if self.logger:
self.logger.info("Cloudify-manager server is UP !")
@@ -160,8 +162,9 @@ class orchestrator:
script += "cfy executions start -w install -d " + dep_name + " --timeout 1800; "
cmd = "/bin/bash -c '" + script + "'"
- execute_command(cmd, self.logger)
-
+ error = execute_command(cmd, self.logger)
+ if error:
+ return error
if self.logger:
self.logger.info("The deployment of {0} is ended".format(dep_name))
@@ -196,11 +199,16 @@ def execute_command(cmd, logger):
if result != "" and logger:
logger.debug(result)
if p == 0:
- return True
+ return False
else:
if logger:
logger.error("Error when executing command %s" % cmd)
- exit(-1)
+ f = open(output_file, 'r')
+ lines = f.readlines()
+ result = lines[len(lines) - 3]
+ result += lines[len(lines) - 2]
+ result += lines[len(lines) - 1]
+ return result
def download_blueprints(blueprint_url, branch, dest_path):