From: Holger Freyther Date: Sun, 19 Feb 2006 18:43:26 +0000 (+0000) Subject: classes/tinderclient.bbclass: X-Git-Tag: 2.6.0~1866^2~2 X-Git-Url: http://code.vuplus.com/gitweb/?a=commitdiff_plain;h=aca193101e2db23661f2a49ba6c18e3192d93229;p=vuplus_openembedded classes/tinderclient.bbclass: -Save the assigned machine id to a file and restore it when needed. BitBake does not have a 'persistent' cache one could use across files... -Post the configuration directly to the server --- diff --git a/classes/tinderclient.bbclass b/classes/tinderclient.bbclass index a50cdda..67762fa 100644 --- a/classes/tinderclient.bbclass +++ b/classes/tinderclient.bbclass @@ -20,18 +20,13 @@ def tinder_form_data(bound, dict, log): return "\r\n".join(output) -def tinder_send_http(d, log): - """ - Send the log via HTTP... - """ - def tinder_time_string(): """ Return the time as GMT """ return "" -def tinder_format_http_post(d,log): +def tinder_format_http_post(d,status,log): """ Format the Tinderbox HTTP post with the data needed for the tinderbox to be happy. @@ -50,6 +45,20 @@ def tinder_format_http_post(d,log): "clobber" : data.getVar('TINDER_CLOBBER', d, True) } + # optionally add the status + if status: + variables["status"] = str(status) + + # try to load the machine id + # we only need on build_status.pl but sending it + # always does not hurt + try: + f = file(data.getVar('TMPDIR',d,True)+'/tinder-machine.id', 'r') + id = f.read() + variables['machine_id'] = id + except: + pass + # the boundary we will need boundary = "----------------------------------%d" % int(random.random()*1000000000000) @@ -69,7 +78,7 @@ def tinder_build_start(d): import httplib # get the body and type - content_type, body = tinder_format_http_post(d,None) + content_type, body = tinder_format_http_post(d,None,None) server = data.getVar('TINDER_HOST', d, True ) url = data.getVar('TINDER_URL', d, True ) @@ -86,10 +95,48 @@ def tinder_build_start(d): h.send(body) errcode, errmsg, headers = h.getreply() print errcode, errmsg, headers + report = h.file.read() + + # now let us find the machine id that was assigned to us + search = "