Skip to content

Commit

Permalink
Bug 1407163: raise exceptions with HTTP error info; r=glandium
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: B3MvsZDpj9a

--HG--
extra : rebase_source : 7066a14f0a0b3b3b7971aa704e446566e1cde7db
  • Loading branch information
djmitche committed Jan 12, 2018
1 parent af7da16 commit e354e64
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions python/mozbuild/mozbuild/mach_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1289,19 +1289,19 @@ class ArtifactRecord(DownloadRecord):
def __init__(self, task_id, artifact_name):
cot = cache._download_manager.session.get(
get_artifact_url(task_id, 'public/chainOfTrust.json.asc'))
cot.raise_for_status()
digest = algorithm = None
if cot.status_code == 200:
# The file is GPG-signed, but we don't care about validating
# that. Instead of parsing the PGP signature, we just take
# the one line we're interested in, which starts with a `{`.
data = {}
for l in cot.content.splitlines():
if l.startswith('{'):
try:
data = json.loads(l)
break
except Exception:
pass
data = {}
# The file is GPG-signed, but we don't care about validating
# that. Instead of parsing the PGP signature, we just take
# the one line we're interested in, which starts with a `{`.
for l in cot.content.splitlines():
if l.startswith('{'):
try:
data = json.loads(l)
break
except Exception:
pass
for algorithm, digest in (data.get('artifacts', {})
.get(artifact_name, {}).items()):
pass
Expand Down

0 comments on commit e354e64

Please sign in to comment.