Fix selection of scopes with empty IPs list

This commit prevents ogcp from always mark as selected/checked scopes
that have an empty IP list.
async-tree
Javier Sánchez Parra 2022-08-22 16:04:52 +02:00
parent 229ad311be
commit 028f810a47
1 changed files with 2 additions and 1 deletions

View File

@ -176,7 +176,8 @@ def add_state_and_ips(scope, clients, ips):
scope['ip'] = []
for child in scope['scope']:
scope['ip'] += add_state_and_ips(child, clients, ips)
scope['selected'] = set(scope['ip']).issubset(ips)
scope['selected'] = (len(scope['ip']) < 0 and
set(scope['ip']).issubset(ips))
return scope['ip']
def get_allowed_scopes(scopes, allowed_scopes):