diff options
author | Jenkins <jenkins@review.openstack.org> | 2015-02-24 06:39:41 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2015-02-24 06:39:41 +0000 |
commit | dc88e429a77f5394f9c7ec146678f82319eb3e59 (patch) | |
tree | e5f28bb3378ffd050ee8e511c93975dd10a91b41 | |
parent | 7dfd8a435592cc4cf02d73707e803a3e902346e7 (diff) | |
parent | f4b2038732a8e4158bc9469a44c9e58f9cd963db (diff) | |
download | turbo-hipster-dc88e429a77f5394f9c7ec146678f82319eb3e59.tar.gz |
Merge "Send results back on failure"
-rw-r--r-- | turbo_hipster/lib/models.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/turbo_hipster/lib/models.py b/turbo_hipster/lib/models.py index 4b0afbd..7029aea 100644 --- a/turbo_hipster/lib/models.py +++ b/turbo_hipster/lib/models.py @@ -121,6 +121,7 @@ class Task(object): self._send_work_data() self.job.sendWorkException(str(e).encode('utf-8')) # No point trying the job, lets return here + self._send_final_results() return # From here we can log exceptions @@ -140,8 +141,6 @@ class Task(object): try: self._cleanup() self._upload_results() - # Finally, send updated work data and completed packets - self._send_final_results() except Exception as e: # If something failed during this section we have been unable # to upload the log. As such raise an exception to gearman @@ -154,6 +153,9 @@ class Task(object): self.messages.append('Exception: %s' % e) self._send_work_data() self.job.sendWorkException(str(e).encode('utf-8')) + finally: + # Finally, send updated work data and completed packets + self._send_final_results() def stop_working(self, number=None): # Check the number is for this job instance (None will cancel all) |