Add source_url to mqtt payload
This commit adds the source_url to the mqtt payload for events emitted by the subunit worker. Just the build_uuid isn't enough to figure out what's going on because we typically do 2 events for each uuid, one with a .gz extension and the other not. We need to distinguish between the 2 to figure out what's actually going on. Change-Id: I56f0b9fb1128b412cd88e49164eb91c3e9e3e4cb
This commit is contained in:
parent
4037e7b1ba
commit
c8b965bde6
@ -111,6 +111,7 @@ class SubunitRetriever(object):
|
||||
|
||||
def _handle_event(self):
|
||||
fields = {}
|
||||
source_url = ''
|
||||
job = self.gearman_worker.getJob()
|
||||
try:
|
||||
arguments = json.loads(job.arguments.decode('utf-8'))
|
||||
@ -138,6 +139,7 @@ class SubunitRetriever(object):
|
||||
if self.mqtt:
|
||||
msg = json.dumps({
|
||||
'build_uuid': out_event.get('build_uuid'),
|
||||
'source_url': source_url,
|
||||
'status': 'success',
|
||||
})
|
||||
self.mqtt.publish_single(msg, out_event.get('project'),
|
||||
@ -148,6 +150,7 @@ class SubunitRetriever(object):
|
||||
if self.mqtt:
|
||||
msg = json.dumps({
|
||||
'build_uuid': fields.get('build_uuid'),
|
||||
'source_url': source_url,
|
||||
'status': 'failed',
|
||||
})
|
||||
self.mqtt.publish_single(msg, fields.get('project'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user