summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ogcp/views.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 875d0ec..4bd1eae 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -943,6 +943,7 @@ def action_image_restore():
form.image.choices.append((image['id'], image['name']))
part_choices = []
+ empty_clients = []
for ip in ips:
r = server.get('/client/setup', payload={'client': [ip]})
if not r:
@@ -968,12 +969,22 @@ def action_image_restore():
choice_value = (disk_id, part_id, part_code, filesystem, part_size)
parts.append(choice_value)
+ if not parts:
+ empty_clients.append(ip)
+
+ if empty_clients:
+ continue
+
if not part_choices: # Use first computer as reference part setup conf
part_choices = [part for part in parts]
elif part_choices != parts:
flash(_(f'Computers have different partition setup'), category='error')
return redirect(url_for('commands'))
+ if empty_clients:
+ flash(_(f'The following clients have not partitions: {" ".join(empty_clients)}'), category='error')
+ return redirect(url_for('commands'))
+
invalid_part_types = get_invalid_image_partition_types()
for disk_id, part_id, part_code, filesystem, part_size in part_choices: