diff options
author | Jeremy Laine <jeremy.laine@m4x.org> | 2008-05-23 09:37:14 +0000 |
---|---|---|
committer | Jeremy Laine <jeremy.laine@m4x.org> | 2008-05-23 09:37:14 +0000 |
commit | 41800d1e3a6804674d3fc807d7a2993aec241f34 (patch) | |
tree | 4eca3050da019ba7eb0452f06c9de6a25248a2bf /classes | |
parent | 2c711b3a33850dd0d1414a564026c041df3dcd12 (diff) |
oestats-client.bbclass: don't include bug number/tracker if empty
Diffstat (limited to 'classes')
-rw-r--r-- | classes/oestats-client.bbclass | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/classes/oestats-client.bbclass b/classes/oestats-client.bbclass index 25388f4636..968aa42c3b 100644 --- a/classes/oestats-client.bbclass +++ b/classes/oestats-client.bbclass @@ -118,7 +118,7 @@ def oestats_task(server, d, task, status): except: elapsed = 0 - # send the log for failures + # prepare files files = {} if status == 'Failed': logs = glob.glob("%s/log.%s.*" % (bb.data.getVar('T', d, True), task)) @@ -130,20 +130,25 @@ def oestats_task(server, d, task, status): 'content': file(log).read(), 'content-type': 'text/plain'} + # prepare report + vars = { + 'build': id, + 'package': bb.data.getVar('PN', d, True), + 'version': bb.data.getVar('PV', d, True), + 'revision': bb.data.getVar('PR', d, True), + 'depends': bb.data.getVar('DEPENDS', d, True), + 'task': task, + 'status': status, + 'time': str(elapsed)} + bug_number = bb.data.getVar('OESTATS_BUG_NUMBER', d, True) + bug_tracker = bb.data.getVar('OESTATS_BUG_TRACKER', d, True) + if bug_number and bug_tracker: + vars['bug_number'] = bug_number + vars['bug_tracker'] = bug_tracker + # send report try: - response = oestats_send(server, "/tasks/", { - 'build': id, - 'package': bb.data.getVar('PN', d, True), - 'version': bb.data.getVar('PV', d, True), - 'revision': bb.data.getVar('PR', d, True), - 'depends': bb.data.getVar('DEPENDS', d, True), - 'task': task, - 'status': status, - 'time': str(elapsed), - 'bug_number': bb.data.getVar('OESTATS_BUG_NUMBER', d, True) or "", - 'bug_tracker': bb.data.getVar('OESTATS_BUG_TRACKER', d, True) or "", - }, files) + response = oestats_send(server, "/tasks/", vars, files) except: bb.note("oestats: error sending task, disabling stats") oestats_setid(d, "") |