Don't exit with error on HTTP 401 when downloading clone bundle

If the server returns HTTP 401 (unauthorized) when attempting to
download clone bundle files, ignore it and continue, rather than
exiting with a fatal error.

Change-Id: I2c7ee03e149c354c7e4ad6ea1ebf266534778fe1
This commit is contained in:
Pascal Bach 2015-02-13 16:23:12 +01:00 committed by David Pursehouse
parent 936183a492
commit 2338788050

2
repo
View File

@ -462,7 +462,7 @@ def _DownloadBundle(url, local, quiet):
try: try:
r = urllib.request.urlopen(url) r = urllib.request.urlopen(url)
except urllib.error.HTTPError as e: except urllib.error.HTTPError as e:
if e.code in [403, 404]: if e.code in [401, 403, 404]:
return False return False
_print('fatal: Cannot get %s' % url, file=sys.stderr) _print('fatal: Cannot get %s' % url, file=sys.stderr)
_print('fatal: HTTP error %s' % e.code, file=sys.stderr) _print('fatal: HTTP error %s' % e.code, file=sys.stderr)