Merge pull request #1915 from coreos-inc/fixbuilder

buildman: spawn_notification w/ attrdict
This commit is contained in:
Jimmy Zelinskie 2016-09-30 18:56:16 -04:00 committed by GitHub
commit 6359cb31da

View file

@ -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])