summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-02 14:50:52 +0200
committerRoberto Hueso Gómez <rhueso@soleta.eu>2020-09-02 14:50:52 +0200
commitef609cf52a24f0b7a5475f247fdf1b0a0197b480 (patch)
treebdb64784ea61a960b0e78369f1199b4bdf6320eb /ogcp/views.py
parentc12ff832c7b46e7af9fa89f4c2f944e047e4c281 (diff)
Rename add_state_to_scopes() function
This function is renamed to add_state_and_ips() which is more accurate.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index a458530..4874ffe 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -20,7 +20,7 @@ def index():
@app.route('/scopes/')
def scopes():
- def add_state_to_scopes(scope, clients):
+ def add_state_and_ips(scope, clients):
if 'ip' in scope:
filtered_client = filter(lambda x: x['addr']==scope['ip'], clients)
client = next(filtered_client, False)
@@ -32,14 +32,14 @@ def scopes():
else:
scope['ip'] = []
for child in scope['scope']:
- scope['ip'] += add_state_to_scopes(child, clients)
+ scope['ip'] += add_state_and_ips(child, clients)
return scope['ip']
r = g.server.get('/scopes')
scopes = r.json()
r = g.server.get('/clients')
clients = r.json()
- add_state_to_scopes(scopes, clients['clients'])
+ add_state_and_ips(scopes, clients['clients'])
return render_template('scopes.html', scopes=scopes, clients=clients)
@app.route('/action/poweroff', methods=['POST'])