Skip to content
Snippets Groups Projects
Commit 36cd03d7 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

BUG: add a retry to get build id

parent 2d907171
No related branches found
No related tags found
Loading
Pipeline #941 failed
......@@ -26,6 +26,7 @@ import re
import unittest
import sys
import json
import time
trace = False
......@@ -176,11 +177,17 @@ site:"+site+", stamp:"+stamp+", name:"+name+", project:"+project+".")
full_url = self.url + buildid_api + buildid_params
if trace:
print("full_url: "+full_url)
response = urllib.request.urlopen(full_url).read().decode()
if trace:
print ( "response: " + response )
nb_try = 3
build_id_regex = re.compile( "<buildid>([0-9]+)</buildid>" )
buildid = build_id_regex.search( response )
while nb_try:
response = urllib.request.urlopen(full_url).read().decode()
if trace:
print ( "response: " + response )
buildid = build_id_regex.search( response )
nb_try -= 1
if buildid or (nb_try == 0):
break
time.sleep(60)
if buildid:
self.buildid = buildid.group(1)
if trace:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment