print 'QUEUED... %s\n' % enqueue_item
def process_requests(build, request_q):
- fail_count = 0
for x in request_q['requests']:
args = x[x.keys()[0]]
a['url'] = request_q['url']
a['obs_target_prj'] = request_q['obs_target_prj']
retry_count = 3
- while retry_count > 0:
- create_project(build, x.keys()[0], args, mode=request_q['reason'])
- break
- if not retry_count:
- print 'retrying failed'
- fail_count += 1
-
- return fail_count
+ while retry_count >= 0:
+ try:
+ create_project(build, x.keys()[0], args, mode=request_q['reason'])
+ break
+ except Exception as err:
+ print 'create_project error: %s' % repr(err)
+ retry_count -= 1
+ if retry_count < 0:
+ return -1
+ return 0
def entry(option):
print option
# Split obs creation job
if len(option) > 2 and option[2] == 'request':
content = trigger_info(os.getenv('TRIGGER_INFO'))
- process_requests(build, content)
- return
+ return process_requests(build, content)
# First store current build and all the rest queued builds
build_queue = []