diff options
author | Rex Lee <limingjiang@huawei.com> | 2017-08-01 02:18:33 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2017-08-01 02:18:33 +0000 |
commit | fe2820e7de65720bacf6533966867949804372bd (patch) | |
tree | b0afd19da8cb48d580bed008981c93eb6d77c870 | |
parent | 07e6f121f9ff5ef221c483aa9c5ec79811bea913 (diff) | |
parent | 6ed2d4867210165fefb8aaabf18dc91b1896064d (diff) |
Merge "Bugfix: yardstick always report 'PASS' to DB"
-rw-r--r-- | yardstick/cmd/commands/task.py | 8 |
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) |