From d709e0f64a327d7efddaaf9b3ece3c9059760ec6 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 3 Feb 2015 13:08:38 -0500 Subject: [PATCH] Fix the new notifications code to work --- buildman/component/buildcomponent.py | 5 +++-- buildman/jobutil/buildjob.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/buildman/component/buildcomponent.py b/buildman/component/buildcomponent.py index 795ab3924..ecd215209 100644 --- a/buildman/component/buildcomponent.py +++ b/buildman/component/buildcomponent.py @@ -267,7 +267,7 @@ class BuildComponent(BaseComponent): trollius.async(self._build_finished(BuildJobResult.COMPLETE)) # Send the notification that the build has completed successfully. - build_job.send_notification('build_success') + self._current_job.send_notification('build_success') except ApplicationError as aex: worker_error = WorkerError(aex.error, aex.kwargs.get('base_error')) @@ -276,7 +276,8 @@ class BuildComponent(BaseComponent): internal_error=worker_error.is_internal_error()) # Send the notification that the build has failed. - build_job.send_notification('build_failure', error_message=worker_error.public_message()) + self._current_job.send_notification('build_failure', + error_message=worker_error.public_message()) # Mark the build as completed. if worker_error.is_internal_error(): diff --git a/buildman/jobutil/buildjob.py b/buildman/jobutil/buildjob.py index b16201918..bb750fc38 100644 --- a/buildman/jobutil/buildjob.py +++ b/buildman/jobutil/buildjob.py @@ -32,7 +32,7 @@ class BuildJob(object): } if error_message is not None: - event_data['error_message'] = message + event_data['error_message'] = error_message spawn_notification(self.repo_build.repository, kind, event_data, subpage='build?current=%s' % self.repo_build.uuid,