views: improve cache check messages in image/restore

Improve the wording of the error message reporting the clients
without enough cache to hold the image to be restored.
master
Alejandro Sirgo Rica 2024-06-19 10:55:23 +02:00
parent 521b7c81ac
commit 2ae6f37e60
1 changed files with 2 additions and 2 deletions

View File

@ -767,10 +767,10 @@ def image_fits_in_cache(server, ips, image_size):
free_cache = cache_size - used_cache
if free_cache < image_size:
missing_cache = image_size - free_cache
err_report += f'{ip}: needs {(missing_cache / (1024 ** 3)):.3f} free GiB<br>'
err_report += f'{ip} requires {(missing_cache / (1024 ** 3)):.3f} free GiB<br>'
if err_report:
flash(f'Client cache error:<br>{err_report}', category='error')
flash(f'No space left on cache:<br>{err_report}', category='error')
return False
return True