From 0fc770b58b75a7adb04604621972d292f131a59d Mon Sep 17 00:00:00 2001 From: Niklas Yann Wettengel Date: Thu, 12 Aug 2021 23:57:32 +0200 Subject: [PATCH] use get_attr --- wgkex/worker/netlink.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wgkex/worker/netlink.py b/wgkex/worker/netlink.py index fcbf4c1..48527f3 100644 --- a/wgkex/worker/netlink.py +++ b/wgkex/worker/netlink.py @@ -182,11 +182,11 @@ def find_stale_wireguard_clients(wg_interface: str) -> List: clients = [] infos = wg.info(wg_interface) for info in infos: - clients.extend(info.WGDEVICE_A_PEERS.value) + clients.extend(info.get_attr('WGDEVICE_A_PEERS')) ret = [ - client.WGPEER_A_PUBLIC_KEY.get("value", "").decode("utf-8") + client.get_attr('WGPEER_A_PUBLIC_KEY').decode("utf-8") for client in clients - if client.WGPEER_A_LAST_HANDSHAKE_TIME.get("tv_sec", int()) + if client.get_attr('WGPEER_A_LAST_HANDSHAKE_TIME').get("tv_sec", int()) < three_hrs_in_secs ] return ret