diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-03-29 14:25:56 +0200 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-03-31 13:54:20 +0200 |
commit | bb39f67a46fc4f39fc78e6191d0600d854d7075f (patch) | |
tree | 837f32a5545944c7b2332c08b358093378eb2227 /ogcp/views.py | |
parent | ce10f04b97359a971b2bb5863a7202746d075892 (diff) |
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.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 8 |
1 files 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' |