From 9b67fff78f810e6dd22459ed5ed5cfb0b8898716 Mon Sep 17 00:00:00 2001 From: Jimmy Zelinskie Date: Fri, 30 Sep 2016 18:54:09 -0400 Subject: [PATCH] buildman: spawn_notification w/ attrdict --- buildman/jobutil/buildjob.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/buildman/jobutil/buildjob.py b/buildman/jobutil/buildjob.py index bfe0d4322..6a2127c2d 100644 --- a/buildman/jobutil/buildjob.py +++ b/buildman/jobutil/buildjob.py @@ -5,6 +5,7 @@ from cachetools import lru_cache from endpoints.notificationhelper import spawn_notification from data import model from util.imagetree import ImageTree +from util.morecollections import AttrDict logger = logging.getLogger(__name__) @@ -52,7 +53,13 @@ class BuildJob(object): if error_message is not None: event_data['error_message'] = error_message - spawn_notification(self.repo_build.repository, kind, event_data, + # TODO(jzelinskie): remove when more endpoints have been converted to using + # interfaces + repo = AttrDict({ + 'namespace_name': self.repo_build.repository.namespace_user.username, + 'name': self.repo_build.repository.name, + }) + spawn_notification(repo, kind, event_data, subpage='build/%s' % self.repo_build.uuid, pathargs=['build', self.repo_build.uuid])