summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-26 12:06:36 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-26 13:21:13 +0200
commit6fecb9d34b62cebcedfc082a3c71c15afb9bb4f0 (patch)
tree8c6eccd9574db63ebe87086822b7dc417f8cbda0 /ogcp/views.py
parent39371747db933df2dbda89d5652addab8ef4c55d (diff)
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.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py7
1 files changed, 6 insertions, 1 deletions
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<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