aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--yardstick/cmd/commands/task.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/yardstick/cmd/commands/task.py b/yardstick/cmd/commands/task.py
index 03f6b1b1e..8d8ea2b3c 100644
--- a/yardstick/cmd/commands/task.py
+++ b/yardstick/cmd/commands/task.py
@@ -51,11 +51,17 @@ class TaskCommands(object): # pragma: no cover
self.output_file = param.output_file
try:
- Task().start(param, **kwargs)
+ result = Task().start(param, **kwargs)
except Exception as e:
self._write_error_data(e)
LOG.exception("")
+ if result.get('result', {}).get('criteria') == 'PASS':
+ LOG.info('Task Success')
+ else:
+ LOG.info('Task Failed')
+ raise RuntimeError('Task Failed')
+
def _write_error_data(self, error):
data = {'status': 2, 'result': str(error)}
write_json_to_file(self.output_file, data)