Adapt log.parse_logs and utils.sort_clients
to Clients.__iter__ return keys instead of values
This commit is contained in:
parent
2ebd445349
commit
8d1c19a734
|
@ -144,7 +144,9 @@ def parse_logs(log_glob, ident_map=None, online_dc=True):
|
||||||
clients.apply_events(itertools.chain.from_iterable(events))
|
clients.apply_events(itertools.chain.from_iterable(events))
|
||||||
|
|
||||||
# find connected clients
|
# find connected clients
|
||||||
online_clients = list(filter(lambda c: c.connected, clients))
|
online_clients = list(
|
||||||
|
filter(lambda c: c.connected, clients.values())
|
||||||
|
)
|
||||||
|
|
||||||
logger.debug(
|
logger.debug(
|
||||||
'Some clients are still connected: %s', online_clients
|
'Some clients are still connected: %s', online_clients
|
||||||
|
|
|
@ -13,7 +13,8 @@ def sort_clients(clients, key_l):
|
||||||
:rtype: list
|
:rtype: list
|
||||||
'''
|
'''
|
||||||
cl_data = [
|
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)
|
return sorted(cl_data, key=lambda data: data[1], reverse=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue