Fix a bug with setting project on topic
This commit fixes a small bug in pulling the project name from the event. Previously it assumed 'project' was always a top level key, but on some event types it's a subkey on the change field.
This commit is contained in:
parent
ca4033c595
commit
74a76a77f0
|
@ -84,6 +84,9 @@ def get_options():
|
|||
def get_topic(base_topic, event):
|
||||
project = event.get('project', '')
|
||||
event_type = event.get('type', '')
|
||||
if not project:
|
||||
if 'change' in event:
|
||||
project = event['change'].get('project', '')
|
||||
pieces = [base_topic, project, event_type]
|
||||
topic = "/".join(pieces)
|
||||
return topic
|
||||
|
|
Loading…
Reference in New Issue