Merge pull request #1920 from coreos-inc/morenotificationfixes
notifications: another switch to repo attrdict
This commit is contained in:
commit
218962e480
2 changed files with 11 additions and 3 deletions
|
@ -4,8 +4,9 @@ import json
|
|||
import re
|
||||
|
||||
from datetime import datetime
|
||||
from notificationhelper import build_event_data
|
||||
from endpoints.notificationhelper import build_event_data
|
||||
from util.jinjautil import get_template_env
|
||||
from util.morecollections import AttrDict
|
||||
from util.secscan import PRIORITY_LEVELS, get_priority_for_index
|
||||
|
||||
template_env = get_template_env("events")
|
||||
|
@ -121,7 +122,13 @@ class VulnerabilityFoundEvent(NotificationEvent):
|
|||
def get_sample_data(self, notification):
|
||||
event_config = json.loads(notification.event_config_json)
|
||||
|
||||
return build_event_data(notification.repository, {
|
||||
# TODO(jzelinskie): remove when more endpoints have been converted to using
|
||||
# interfaces
|
||||
repo = AttrDict({
|
||||
'namespace_name': notification.repository.namespace_user.username,
|
||||
'name': notification.repository.name,
|
||||
})
|
||||
return build_event_data(repo, {
|
||||
'tags': ['latest', 'prod'],
|
||||
'image': 'some-image-id',
|
||||
'vulnerability': {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import json
|
||||
|
||||
from app import app, notification_queue
|
||||
from data import model
|
||||
from auth.auth_context import get_authenticated_user, get_validated_oauth_token
|
||||
|
||||
import json
|
||||
|
||||
def build_event_data(repo, extra_data={}, subpage=None):
|
||||
repo_string = '%s/%s' % (repo.namespace_name, repo.name)
|
||||
|
|
Reference in a new issue