improve logging, clear using print
[yardstick.git] / yardstick / cmd / commands / task.py
index 03f6b1b..e2e8bf6 100644 (file)
@@ -50,12 +50,20 @@ class TaskCommands(object):     # pragma: no cover
         param = change_osloobj_to_paras(args)
         self.output_file = param.output_file
 
+        result = {}
+        LOG.info('Task START')
         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)