summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-08-03 17:30:50 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-27 09:48:35 +0200
commit279184df5f6b49ec6f63d3ccb97fbe002da1a85a (patch)
treee7ffac687f453f8a9e2be2f73b34c0f5b3b02225 /ogcp/views.py
parentaf0a3255b470e9e0db1fe19de680a7abb66b0641 (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.py12
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