Skip to content

Commit

Permalink
fix a bug where we return incorrectly
Browse files Browse the repository at this point in the history
Signed-off-by: Trishank K Kuppusamy <trishank.kuppusamy@datadoghq.com>
  • Loading branch information
trishankatdatadog committed Jun 18, 2019
1 parent fef3240 commit fbff603
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tuf/client/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,14 +1132,14 @@ def _update_root_metadata(self, current_root_metadata):
"""

def neither_403_nor_404(mirror_error):
WHITELIST = {403, 404}
if isinstance(mirror_error, six.moves.urllib.error.HTTPError):
if mirror_error.code in {403, 404}:
if mirror_error.code in WHITELIST:
return False
elif isinstance(mirror_error, requests.exceptions.HTTPError):
if mirror_error.response.status_code in {403, 404}:
if mirror_error.response.status_code in WHITELIST:
return False
else:
return True
return True

# Temporarily set consistent snapshot. Will be updated to whatever is set
# in the latest root.json after running through the intermediates with
Expand Down

0 comments on commit fbff603

Please sign in to comment.