diff options
author | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-08-03 17:30:50 +0200 |
---|---|---|
committer | Javier Sánchez Parra <jsanchez@soleta.eu> | 2022-08-05 13:40:37 +0200 |
commit | 45fc0ec787b1c1f3ba1ac12f22c6cf69bb46122a (patch) | |
tree | 95aa5fa3421ab811252c31b31478ba1b9e6e103a /ogcp/views.py | |
parent | 9c8b0432b1be4528d2bc493c8dd3ae09c83c385c (diff) |
Fetch clients from all ogServers in the dashboard
With this commit, ogcp fetch all clients lists an join them.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index a26ad55..fe17528 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -117,10 +117,18 @@ def get_client_setup(ip): return db_partitions def get_clients(state_filter=None): - r = g.server.get('/clients') - clients = r.json() + responses = multi_request('get', '/clients') + + clients_list = [] + for r in responses: + clients_list = clients_list + r['json']['clients'] + + clients = {} + clients['clients'] = clients_list + if state_filter: return filter(clients.items(), lambda c: c.state == state_filter) + return clients |