Handle pulling the project from ref-updated events

This commit fixes a bug when trying to process ref-update events.
The formatting was different for these events was different and
the project is a subfield on the refUpdate dict.
This commit is contained in:
Matthew Treinish 2016-05-26 12:33:38 -04:00
parent 74a76a77f0
commit 97c78e78ff
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
1 changed files with 2 additions and 0 deletions

View File

@ -87,6 +87,8 @@ def get_topic(base_topic, event):
if not project:
if 'change' in event:
project = event['change'].get('project', '')
elif 'refUpdate' in event:
project = event['refUpdate'].get('project', '')
pieces = [base_topic, project, event_type]
topic = "/".join(pieces)
return topic