Skip to content

Commit c484cb2

Browse files
committed
lab: add retry code for https://
1 parent fb108b8 commit c484cb2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

roberta/lab.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,12 @@ def _request(self, cmd, headers, timeout):
244244
except urllib2.HTTPError as e:
245245
if e.code == 404 and '/rest/' not in url:
246246
logger.warning("HTTPError(%s): %s, retrying with '/rest'" % (e.code, e.reason))
247-
# upstream change the server path
247+
# upstream changed the server path
248248
url = '%s/rest/%s' % (self.address, cmd)
249+
elif e.code == 405 and not url.startswith('https://'):
250+
logger.warning("HTTPError(%s): %s, retrying with 'https://'" % (e.code, e.reason))
251+
self.address = "https" + self.address[4:]
252+
url = "https" + url[4:]
249253
else:
250254
raise e
251255
return None

0 commit comments

Comments
 (0)