mirror of https://git.48k.eu/ogcp
views: report clients without cache in fetch and restore
Report clients without cache partition inthe decks of the target clients with enough cache to fit the target image.master
parent
39371747db
commit
6fecb9d34b
|
@ -967,12 +967,17 @@ def image_fits_in_cache(server, clients_info, image):
|
|||
continue
|
||||
|
||||
free_cache = client_info['free_cache']
|
||||
used_cache = client_info['used_cache']
|
||||
if used_cache == 0 and free_cache == 0:
|
||||
err_report += f'{ip} has no cache partition<br>'
|
||||
continue
|
||||
|
||||
if free_cache < image_size:
|
||||
missing_cache = image_size - free_cache
|
||||
err_report += f'{ip} requires {(missing_cache / (1024 ** 3)):.3f} more free GiB<br>'
|
||||
|
||||
if err_report:
|
||||
flash(f'No space left on cache:<br>{err_report}', category='error')
|
||||
flash(f'{err_report}', category='error')
|
||||
return False
|
||||
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue