From: Jeremy Laine Date: Sun, 18 May 2008 16:03:15 +0000 (+0000) Subject: oestats-client.bbclass: catch errors communicating with stats server X-Git-Tag: Release-2010-05/1~6894 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f59aca1e53304c3904a4036db610c79fd29f81;p=openembedded.git oestats-client.bbclass: catch errors communicating with stats server --- 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 () {