From 3097ab0f62233dc336dfe611fef4b8b633355190 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 27 May 2006 21:49:50 +0000 Subject: Sync conf and classes with OE - changes have been tested and don't affect poky git-svn-id: https://svn.o-hand.com/repos/poky/trunk@446 311d38ba-8fff-0310-9ca6-ca027cbcb966 --- openembedded/classes/tinderclient.bbclass | 43 +++++++++++++++++-------------- 1 file changed, 24 insertions(+), 19 deletions(-) (limited to 'openembedded/classes/tinderclient.bbclass') diff --git a/openembedded/classes/tinderclient.bbclass b/openembedded/classes/tinderclient.bbclass index f9243f7108..6e10d0f34b 100644 --- a/openembedded/classes/tinderclient.bbclass +++ b/openembedded/classes/tinderclient.bbclass @@ -1,3 +1,21 @@ +def tinder_http_post(server, selector, content_type, body): + import httplib + # now post it + for i in range(0,5): + try: + h = httplib.HTTP(server) + h.putrequest('POST', selector) + h.putheader('content-type', content_type) + h.putheader('content-length', str(len(body))) + h.endheaders() + h.send(body) + errcode, errmsg, headers = h.getreply() + #print errcode, errmsg, headers + return (errcode,errmsg, headers, h.file) + except: + # try again + pass + def tinder_form_data(bound, dict, log): output = [] #br @@ -29,7 +47,7 @@ def tinder_format_http_post(d,status,log): for the tinderbox to be happy. """ - from bb import data + from bb import data, build import os,random # the variables we will need to send on this form post @@ -72,7 +90,6 @@ def tinder_build_start(d): on the server. """ from bb import data - import httplib # get the body and type content_type, body = tinder_format_http_post(d,None,None) @@ -84,15 +101,9 @@ def tinder_build_start(d): #print "selector %s and url %s" % (selector, url) # now post it - h = httplib.HTTP(server) - h.putrequest('POST', selector) - h.putheader('content-type', content_type) - h.putheader('content-length', str(len(body))) - h.endheaders() - h.send(body) - errcode, errmsg, headers = h.getreply() + errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body) #print errcode, errmsg, headers - report = h.file.read() + report = h_file.read() # now let us find the machine id that was assigned to us search = "