After upload _service, if catches 'Bad Request',
Obs service should enough time to execute.
Change-Id: Ib52d1439ea3969d3f0d2021d4f8f12e86e32f5f9
import atexit
import ast
from time import sleep
+from urllib2 import HTTPError
# internal module
from common import runner
# create SR
status = True
if obs_stg_prj != obs_dst_prj:
- sr_retry_count = 3
+ sr_retry_count = 10
while sr_retry_count > 0:
try:
- sleep(6)
+ sleep(30)
newreq = localpkg.submit_req(obs_dst_prj,
msg=commit_msg)
print 'New request %s is created' % newreq
status = True
break
- except Exception, err:
+ except HTTPError, err:
print 'New request failed to be created'
print err
- sr_retry_count -= 1
status = False
+ if err.msg != "Bad Request":
+ break
+ sr_retry_count -= 1
if status:
break
retry_count -= 1