Commit 2deff4e3 authored by Guido Gunther's avatar Guido Gunther
Browse files

Merge branch 'verify-checksum' into 'master'

flash-image: Make lack of meta data fatal

See merge request Librem5/librem5-devkit-tools!17
parents f362dd31 4c23d1e9
......@@ -135,16 +135,10 @@ def download_image(url, target, attempts):
# We expect metadata to be right next to the image
meta_yml_url = "{}/{}".format(url.rsplit('/', 1)[0], META_YAML)
resp = requests.get(meta_yml_url)
# No meta data is no yet fatal
try:
resp.raise_for_status()
meta = yaml.safe_load(resp.text)
uncompressed_size = int(meta['image']['size'])
logging.debug("Image size is %d", uncompressed_size)
except requests.exceptions.HTTPError:
logging.warning("No meta data found, skipping integrity check")
meta = None
uncompressed_size = UNCOMPRESSED_SIZE
resp.raise_for_status()
meta = yaml.safe_load(resp.text)
uncompressed_size = int(meta['image']['size'])
logging.debug("Image size is %d", uncompressed_size)
stream, ts = stream_file(url, attempts)
download_bar = tqdm.tqdm(total=ts,
......
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