Commit 34f09b87 authored by David Dorwin's avatar David Dorwin Committed by Commit Bot

[fuchsia] Only write boot image signature on download success

Previously, the file was always written, even in the case of an
exception.

Change-Id: I0cee215b529f6864c8c14fc90934de2fc7f44974
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466738Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Commit-Queue: David Dorwin <ddorwin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817297}
parent 5af9a9dd
......@@ -128,13 +128,13 @@ def main():
try:
DownloadSdkBootImages(bucket, sdk_hash, args.boot_images,
args.image_root_dir)
with open(signature_filename, 'w') as f:
f.write(new_signature)
except subprocess.CalledProcessError as e:
logging.error(("command '%s' failed with status %d.%s"), " ".join(e.cmd),
e.returncode, " Details: " + e.output if e.output else "")
with open(signature_filename, 'w') as f:
f.write(new_signature)
return 0
......
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