mirror of
git://git.yoctoproject.org/yocto-autobuilder2.git
synced 2025-07-19 12:49:03 +02:00
reporters/swatbot: Improve swat_monitor handling
The property may be unset, avoid tracebacks if so. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
ccdf468d32
commit
1f07a1768f
|
@ -64,7 +64,6 @@ class SwatBotURI(object):
|
|||
"buildid": collection_build_id,
|
||||
"targetname": build['builder']['name'],
|
||||
"branch": build['properties']['branch_poky'][0],
|
||||
"forswat": build['properties']['swat_monitor'][0],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +74,10 @@ class SwatBotURI(object):
|
|||
payload['data']['attributes']['reason'] = build['properties']['reason'][0]
|
||||
if 'owner' in build['properties'] and build['properties']['owner'][0]:
|
||||
payload['data']['attributes']['owner'] = build['properties']['owner'][0]
|
||||
if 'swat_monitor' build['properties'] and build['properties']['swat_monitor'][0]:
|
||||
payload['data']['attributes']['forswat'] = True
|
||||
else:
|
||||
payload['data']['attributes']['forswat'] = False
|
||||
|
||||
try:
|
||||
req = self.client.post(url, json=payload, timeout=self.TIMEOUT, headers=self.headers)
|
||||
|
|
Loading…
Reference in New Issue
Block a user