summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 12:31:05 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-09-02 12:50:30 +0200
commita9bbb10e8402d99b009f1ea95b38a7b228b2d83b (patch)
treee8b8d6972af56b6e774906473dff088ad5114247 /ogcp
parent4ba34ca594736940f3778f527214cacf0421059e (diff)
Adapt MAC retrieving to support several ogServers
Clients pills show MACs regardless of the ogServer they belong to. Flask GET /client/mac API uses "get_server_from_clients()" function to send the command to the correct ogServer.
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 0511d3c..16cdfd1 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -387,7 +387,8 @@ def scopes_status():
def get_client_mac():
ip = parse_elements(request.args.to_dict())
payload = {'client': list(ip)}
- resp = g.server.get('/client/info', payload)
+ server = get_server_from_clients(list(ip))
+ resp = server.get('/client/info', payload)
client_info = resp.json()
mac = client_info.get('mac')
pretty_mac = (':'.join(mac[i:i+2] for i in range(0, 12, 2))).upper()