diff options
Diffstat (limited to 'meta/classes/tinderclient.bbclass')
-rw-r--r-- | meta/classes/tinderclient.bbclass | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/classes/tinderclient.bbclass b/meta/classes/tinderclient.bbclass index 2bc75fc65e..917b74d887 100644 --- a/meta/classes/tinderclient.bbclass +++ b/meta/classes/tinderclient.bbclass | |||
@@ -10,10 +10,10 @@ def tinder_http_post(server, selector, content_type, body): | |||
10 | h.endheaders() | 10 | h.endheaders() |
11 | h.send(body) | 11 | h.send(body) |
12 | errcode, errmsg, headers = h.getreply() | 12 | errcode, errmsg, headers = h.getreply() |
13 | #print errcode, errmsg, headers | 13 | #print(errcode, errmsg, headers) |
14 | return (errcode,errmsg, headers, h.file) | 14 | return (errcode,errmsg, headers, h.file) |
15 | except: | 15 | except: |
16 | print "Error sending the report!" | 16 | print("Error sending the report!") |
17 | # try again | 17 | # try again |
18 | pass | 18 | pass |
19 | 19 | ||
@@ -82,7 +82,7 @@ def tinder_format_http_post(d,status,log): | |||
82 | # we only need on build_status.pl but sending it | 82 | # we only need on build_status.pl but sending it |
83 | # always does not hurt | 83 | # always does not hurt |
84 | try: | 84 | try: |
85 | f = file(d.getVar('TMPDIR',True)+'/tinder-machine.id', 'r') | 85 | f = open(d.getVar('TMPDIR',True)+'/tinder-machine.id', 'r') |
86 | id = f.read() | 86 | id = f.read() |
87 | variables['machine_id'] = id | 87 | variables['machine_id'] = id |
88 | except: | 88 | except: |
@@ -111,11 +111,11 @@ def tinder_build_start(d): | |||
111 | 111 | ||
112 | selector = url + "/xml/build_start.pl" | 112 | selector = url + "/xml/build_start.pl" |
113 | 113 | ||
114 | #print "selector %s and url %s" % (selector, url) | 114 | #print("selector %s and url %s" % (selector, url)) |
115 | 115 | ||
116 | # now post it | 116 | # now post it |
117 | errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body) | 117 | errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body) |
118 | #print errcode, errmsg, headers | 118 | #print(errcode, errmsg, headers) |
119 | report = h_file.read() | 119 | report = h_file.read() |
120 | 120 | ||
121 | # now let us find the machine id that was assigned to us | 121 | # now let us find the machine id that was assigned to us |
@@ -127,7 +127,7 @@ def tinder_build_start(d): | |||
127 | 127 | ||
128 | # now we will need to save the machine number | 128 | # now we will need to save the machine number |
129 | # we will override any previous numbers | 129 | # we will override any previous numbers |
130 | f = file(d.getVar('TMPDIR', True)+"/tinder-machine.id", 'w') | 130 | f = open(d.getVar('TMPDIR', True)+"/tinder-machine.id", 'w') |
131 | f.write(report) | 131 | f.write(report) |
132 | 132 | ||
133 | 133 | ||
@@ -147,8 +147,8 @@ def tinder_send_http(d, status, _log): | |||
147 | while len(new_log) > 0: | 147 | while len(new_log) > 0: |
148 | content_type, body = tinder_format_http_post(d,status,new_log[0:18000]) | 148 | content_type, body = tinder_format_http_post(d,status,new_log[0:18000]) |
149 | errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body) | 149 | errcode, errmsg, headers, h_file = tinder_http_post(server,selector,content_type, body) |
150 | #print errcode, errmsg, headers | 150 | #print(errcode, errmsg, headers) |
151 | #print h.file.read() | 151 | #print(h.file.read()) |
152 | new_log = new_log[18000:] | 152 | new_log = new_log[18000:] |
153 | 153 | ||
154 | 154 | ||
@@ -278,7 +278,7 @@ def tinder_do_tinder_report(event): | |||
278 | 278 | ||
279 | try: | 279 | try: |
280 | # truncate the tinder log file | 280 | # truncate the tinder log file |
281 | f = file(event.data.getVar('TINDER_LOG', True), 'w') | 281 | f = open(event.data.getVar('TINDER_LOG', True), 'w') |
282 | f.write("") | 282 | f.write("") |
283 | f.close() | 283 | f.close() |
284 | except: | 284 | except: |
@@ -287,7 +287,7 @@ def tinder_do_tinder_report(event): | |||
287 | try: | 287 | try: |
288 | # write a status to the file. This is needed for the -k option | 288 | # write a status to the file. This is needed for the -k option |
289 | # of BitBake | 289 | # of BitBake |
290 | g = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') | 290 | g = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') |
291 | g.write("") | 291 | g.write("") |
292 | g.close() | 292 | g.close() |
293 | except IOError: | 293 | except IOError: |
@@ -319,14 +319,14 @@ def tinder_do_tinder_report(event): | |||
319 | log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True) | 319 | log += "<--- TINDERBOX Package %s failed (FAILURE)\n" % event.data.getVar('PF', True) |
320 | status = 200 | 320 | status = 200 |
321 | # remember the failure for the -k case | 321 | # remember the failure for the -k case |
322 | h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') | 322 | h = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') |
323 | h.write("200") | 323 | h.write("200") |
324 | elif name == "BuildCompleted": | 324 | elif name == "BuildCompleted": |
325 | log += "Build Completed\n" | 325 | log += "Build Completed\n" |
326 | status = 100 | 326 | status = 100 |
327 | # Check if we have a old status... | 327 | # Check if we have a old status... |
328 | try: | 328 | try: |
329 | h = file(event.data.getVar('TMPDIR',True)+'/tinder-status', 'r') | 329 | h = open(event.data.getVar('TMPDIR',True)+'/tinder-status', 'r') |
330 | status = int(h.read()) | 330 | status = int(h.read()) |
331 | except: | 331 | except: |
332 | pass | 332 | pass |
@@ -342,7 +342,7 @@ def tinder_do_tinder_report(event): | |||
342 | log += "Error:Was Runtime: %d\n" % event.isRuntime() | 342 | log += "Error:Was Runtime: %d\n" % event.isRuntime() |
343 | status = 200 | 343 | status = 200 |
344 | # remember the failure for the -k case | 344 | # remember the failure for the -k case |
345 | h = file(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') | 345 | h = open(event.data.getVar('TMPDIR', True)+"/tinder-status", 'w') |
346 | h.write("200") | 346 | h.write("200") |
347 | 347 | ||
348 | # now post the log | 348 | # now post the log |