Send the work data result as soon as we know it
Change-Id: I40b46e19d298f18b3ca3cf031612ae94b3874bfa
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py
index 3424e86..2fca46c 100644
--- a/turbo_hipster/lib/models.py
+++ b/turbo_hipster/lib/models.py
@@ -92,17 +92,19 @@
""" Send the WORK DATA in json format for job """
self.log.debug("Send the work data response: %s" %
json.dumps(self._get_work_data()))
+ if self.success:
+ self.work_data['result'] = 'SUCCESS'
+ else:
+ self.work_data['result'] = '\n'.join(self.messages)
self.job.sendWorkData(json.dumps(self._get_work_data()))
def _send_final_results(self):
self._send_work_data()
if self.success:
- self.work_data['result'] = 'SUCCESS'
self.job.sendWorkComplete(
json.dumps(self._get_work_data()))
else:
- self.work_data['result'] = '\n'.join(self.messages)
self.job.sendWorkFail()
def _do_next_step(self):