summaryrefslogtreecommitdiff
path: root/classes/oestats-client.bbclass
diff options
context:
space:
mode:
authorJeremy Laine <jeremy.laine@m4x.org>2008-05-18 16:03:15 +0000
committerJeremy Laine <jeremy.laine@m4x.org>2008-05-18 16:03:15 +0000
commitc9f59aca1e53304c3904a4036db610c79fd29f81 (patch)
tree695985571b6241e4c53fd3c8a3b80fac4ba9bd80 /classes/oestats-client.bbclass
parentc2162b48ef6c5a33e22e497e509a7c0763b42760 (diff)
oestats-client.bbclass: catch errors communicating with stats server
Diffstat (limited to 'classes/oestats-client.bbclass')
-rw-r--r--classes/oestats-client.bbclass31
1 files changed, 19 insertions, 12 deletions
diff --git a/classes/oestats-client.bbclass b/classes/oestats-client.bbclass
index a57bd92bce..880f02e62d 100644
--- a/classes/oestats-client.bbclass
+++ b/classes/oestats-client.bbclass
@@ -70,7 +70,7 @@ def oestats_start(server, builder, d):
if id:
bb.note("oestats: build %s" % id)
else:
- bb.note("oestats: server error, disabling stats")
+ bb.note("oestats: error starting build, disabling stats")
oestats_setid(d, id)
def oestats_stop(server, d, status):
@@ -81,9 +81,12 @@ def oestats_stop(server, d, status):
if not id: return
# send report
- response = oestats_send(server, "/builds/stop/%s/" % id, {
- 'status': status,
- })
+ try:
+ response = oestats_send(server, "/builds/stop/%s/" % id, {
+ 'status': status,
+ })
+ except:
+ bb.note("oestats: error stopping build")
def oestats_task(server, d, task, status):
import bb
@@ -100,14 +103,18 @@ def oestats_task(server, d, task, status):
elapsed = 0
# send report
- response = oestats_send(server, "/builds/task/%s/" % id, {
- 'package': bb.data.getVar('PN', d, True),
- 'version': bb.data.getVar('PV', d, True),
- 'revision': bb.data.getVar('PR', d, True),
- 'task': task,
- 'status': status,
- 'time': str(elapsed),
- })
+ try:
+ response = oestats_send(server, "/builds/task/%s/" % id, {
+ 'package': bb.data.getVar('PN', d, True),
+ 'version': bb.data.getVar('PV', d, True),
+ 'revision': bb.data.getVar('PR', d, True),
+ 'task': task,
+ 'status': status,
+ 'time': str(elapsed),
+ })
+ except:
+ bb.note("oestats: error sending task, disabling stats")
+ oestats_setid(d, "")
addhandler oestats_eventhandler
python oestats_eventhandler () {