mirror of https://git.48k.eu/ogclient
utils: add error checks to checksum file creation in tip_write_csum
Add a check for potential permission or IO errors during the creation of the image checksum.master
parent
abea6583d3
commit
6bfbf6cc7b
|
@ -51,8 +51,11 @@ def tip_write_csum(image_name):
|
||||||
|
|
||||||
filename = image_path + ".full.sum"
|
filename = image_path + ".full.sum"
|
||||||
csum = _compute_md5(image_path)
|
csum = _compute_md5(image_path)
|
||||||
with open(filename, 'w') as f:
|
try:
|
||||||
f.write(csum)
|
with open(filename, 'w') as f:
|
||||||
|
f.write(csum)
|
||||||
|
except OSError as e:
|
||||||
|
raise OgError(f'Could not write {filename}, reported: {e}') from e
|
||||||
|
|
||||||
return csum
|
return csum
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue