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-09-27 09:48:35 +0200 |
commit | 279184df5f6b49ec6f63d3ccb97fbe002da1a85a (patch) | |
tree | e7ffac687f453f8a9e2be2f73b34c0f5b3b02225 | |
parent | af0a3255b470e9e0db1fe19de680a7abb66b0641 (diff) |
Fetch clients from all ogServers in the dashboard
With this commit, ogcp fetch all clients lists an join them.
-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 |