Commit 318396c2 authored by Avi Drissman's avatar Avi Drissman Committed by Commit Bot

Log command output if it can't be parsed

If `xcrun altool` returns data that can't be parsed or correctly
interpreted, rethrow with the actual data so that the data is logged.
This way, the next time it happens we can see what bad data is being
returned and will be able to make the notarization tool more robust.

Bug: none
Change-Id: Icb4ceaa669b37ef9cdda7d8abd8f478532108fe0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147816Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#758533}
parent d84b2b19
...@@ -43,10 +43,16 @@ def submit(path, config): ...@@ -43,10 +43,16 @@ def submit(path, config):
if config.notary_asc_provider is not None: if config.notary_asc_provider is not None:
command.extend(['--asc-provider', config.notary_asc_provider]) command.extend(['--asc-provider', config.notary_asc_provider])
output = commands.run_command_output(command) output = commands.run_command_output(command)
plist = plistlib.loads(output) try:
uuid = plist['notarization-upload']['RequestUUID'] plist = plistlib.loads(output)
logger.info('Submitted %s for notarization, request UUID: %s.', path, uuid) uuid = plist['notarization-upload']['RequestUUID']
return uuid logger.info('Submitted %s for notarization, request UUID: %s.', path,
uuid)
return uuid
except:
raise NotarizationError(
'xcrun altool returned output that could not be parsed: {}'.format(
output))
def wait_for_results(uuids, config): def wait_for_results(uuids, config):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment