Fix bugs in the initial impl of the notification event and notification method libs.

This commit is contained in:
Joseph Schorr 2014-07-18 11:52:36 -04:00
parent 8d7493cb86
commit df7b8d651c
2 changed files with 15 additions and 8 deletions

View file

@ -54,11 +54,11 @@ class RepoPushEvent(NotificationEvent):
return 'repo_push'
def get_summary(self, notification_data):
return 'Repository %s updated' % (event_data['repository'])
return 'Repository %s updated' % (notification_data['event_data']['repository'])
def get_message(self, notification_data):
event_data = notification_data['event_data']
if not event_data['tags']:
if not event_data.get('updated_tags', []):
return '%s images pushed for repository %s (%s)' % (event_data['pushed_image_count'],
event_data['repository'], event_data['homepage'])
@ -86,7 +86,7 @@ class BuildStartEvent(NotificationEvent):
def event_name(cls):
return 'build_start'
def get_sample_data(repository=None):
def get_sample_data(self, repository=None):
pass
@ -95,7 +95,7 @@ class BuildSuccessEvent(NotificationEvent):
def event_name(cls):
return 'build_success'
def get_sample_data(repository=None):
def get_sample_data(self, repository=None):
pass
@ -104,5 +104,5 @@ class BuildFailureEvent(NotificationEvent):
def event_name(cls):
return 'build_failure'
def get_sample_data(repository=None):
def get_sample_data(self, repository=None):
pass