diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-02 16:15:21 +0200 |
---|---|---|
committer | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-09-03 09:42:23 +0200 |
commit | 15f5af00e73bac87d329d47de257cad50a591b06 (patch) | |
tree | 71097e53fc043a4cfab47b0643f476a6496befb0 /ogcp/views.py | |
parent | b433d8409586fb9a16e50ed0262a96dd6490a014 (diff) |
templates: show excluded clients from partition operation
Show the list of IPs of the clients withut the selected disk to
partition in the partition and format form.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 397831e..4fa14a9 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -697,9 +697,12 @@ def get_common_disk_data(ips): } break - for disk_id in disk_data: - if disk_id not in setup_data: - disk_data[disk_id]['excluded'].append(ip) + for disk_id in disk_data: + disk_ips = [] + for disk_size in disk_data[disk_id]['inventory']: + disk_ips.extend(disk_data[disk_id]['inventory'][disk_size]) + + disk_data[disk_id]['excluded'] = [ip for ip in ips if ip not in disk_ips] return disk_data @@ -775,6 +778,10 @@ def action_setup_show(): for disk in setup_data: setup_data[disk][0]['size'] = common_disk_data[disk]['common_size'] + excluded_client_disks = {} + for disk in common_disk_data: + excluded_client_disks[disk] = common_disk_data[disk]['excluded'] + form = SetupForm() form.ips.data = ips_str @@ -785,6 +792,7 @@ def action_setup_show(): scopes, _clients = get_scopes(ips) return render_template('actions/setup.html', + excluded_client_disks=excluded_client_disks, selected_disk=selected_disk, setup_data=setup_data, disk_form=form, |