From bb39f67a46fc4f39fc78e6191d0600d854d7075f Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Tue, 29 Mar 2022 14:25:56 +0200 Subject: Change get_client_setup to receive a string get_client_setup() takes an IP address that identify the client, instead of passing an iterator with one single IP address, pass directly such IP address. --- ogcp/views.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ogcp/views.py b/ogcp/views.py index 8ff0c2b..802b4bc 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -98,7 +98,7 @@ def parse_elements(checkboxes_dict): return elements def get_client_setup(ip): - payload = payload = {'client': list(ip)} + payload = {'client': [ip]} r = g.server.get('/client/setup', payload) db_partitions = r.json()['partitions'] for partition in db_partitions: @@ -347,7 +347,8 @@ def action_setup_show(): if not validate_elements(ips): return redirect(url_for('commands')) - db_partitions = get_client_setup(ips) + ip = list(ips)[0] + db_partitions = get_client_setup(ip) filtered_partitions = [p for p in db_partitions if p.get('disk') == selected_disk] @@ -652,7 +653,8 @@ def action_client_info(): r = g.server.get('/images') images = r.json()['images'] - setup = get_client_setup(ips) + ip = list(ips)[0] + setup = get_client_setup(ip) if setup and setup[0].get('code') == 'MSDOS': setup[0]['code'] = 'MBR' -- cgit v1.2.3-18-g5258