summaryrefslogtreecommitdiff
path: root/openembedded/classes/tinderclient.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-05-27 21:49:50 +0000
committerRichard Purdie <richard@openedhand.com>2006-05-27 21:49:50 +0000
commit3097ab0f62233dc336dfe611fef4b8b633355190 (patch)
tree8173abc003c9703cf625d4e100f57d3d5141177d /openembedded/classes/tinderclient.bbclass
parentb77fcc05cacdf70819cc226d53156a9e70e84e04 (diff)
downloadopenembedded-core-3097ab0f62233dc336dfe611fef4b8b633355190.tar.gz
openembedded-core-3097ab0f62233dc336dfe611fef4b8b633355190.tar.bz2
openembedded-core-3097ab0f62233dc336dfe611fef4b8b633355190.zip
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
Diffstat (limited to 'openembedded/classes/tinderclient.bbclass')
-rw-r--r--openembedded/classes/tinderclient.bbclass43
1 files changed, 24 insertions, 19 deletions
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 = "<machine id='"
@@ -113,7 +124,6 @@ def tinder_send_http(d, status, log):
Send this log as build status
"""
from bb import data
- import httplib
# get the body and type
@@ -124,13 +134,7 @@ def tinder_send_http(d, status, log):
selector = url + "/xml/build_status.pl"
# 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
#print h.file.read()
@@ -247,7 +251,7 @@ def tinder_do_tinder_report(event):
implemented yet.
"""
from bb.event import getName
- from bb import data, mkdirhier
+ from bb import data, mkdirhier, build
import os, glob
# variables
@@ -289,6 +293,7 @@ def tinder_do_tinder_report(event):
elif name == "PkgSucceeded":
log += "<--- TINDERBOX Package %s done (SUCCESS)\n" % data.getVar('P', event.data, True)
elif name == "PkgFailed":
+ build.exec_task('do_clean', event.data)
log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % data.getVar('P', event.data, True)
status = 200
elif name == "BuildCompleted":