From 6fecb9d34b62cebcedfc082a3c71c15afb9bb4f0 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 26 Sep 2024 12:06:36 +0200 Subject: 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. --- ogcp/views.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index 75114b7..b6a0cd7 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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
' + 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
' if err_report: - flash(f'No space left on cache:
{err_report}', category='error') + flash(f'{err_report}', category='error') return False return True -- cgit v1.2.3-18-g5258