Adapt log.parse_logs and utils.sort_clients

to Clients.__iter__ return keys instead of values
This commit is contained in:
Thor77 2017-09-25 23:17:51 +02:00
parent 2ebd445349
commit 8d1c19a734
2 changed files with 5 additions and 2 deletions

View File

@ -144,7 +144,9 @@ def parse_logs(log_glob, ident_map=None, online_dc=True):
clients.apply_events(itertools.chain.from_iterable(events))
# find connected clients
online_clients = list(filter(lambda c: c.connected, clients))
online_clients = list(
filter(lambda c: c.connected, clients.values())
)
logger.debug(
'Some clients are still connected: %s', online_clients

View File

@ -13,7 +13,8 @@ def sort_clients(clients, key_l):
:rtype: list
'''
cl_data = [
(client, key_l(client)) for client in clients if key_l(client) > 0
(client, key_l(client)) for client in clients.values()
if key_l(client) > 0
]
return sorted(cl_data, key=lambda data: data[1], reverse=True)