From 3f8d85d50bc63b4ebb6b9ab81e32c524757d0956 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Fri, 29 Sep 2017 18:53:51 +0200 Subject: [PATCH] forgot expires here --- tools/client.py | 2 +- tools/storage.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/client.py b/tools/client.py index c80e525..0e66137 100644 --- a/tools/client.py +++ b/tools/client.py @@ -134,7 +134,7 @@ class Client(object): def commit_rule(self): - rule = self.find_rule(self._ip_address, self.protocol) + rule = self.find_rule(self.ip_address, self.protocol) if not rule: rule = iptc.Rule() rule.src = self.ip_address diff --git a/tools/storage.py b/tools/storage.py index bef4d9d..7efa443 100644 --- a/tools/storage.py +++ b/tools/storage.py @@ -66,15 +66,15 @@ class StoragePostgres(object): 'enabled, last_packets, last_activity, expires) values ' '(%s, %s, %s, %s, %s, %s, %s, %s) on conflict (client_id, ' 'ip_address, protocol) do update set (enabled, last_packets, ' - 'last_activity) = (EXCLUDED.enabled, EXCLUDED.last_packets, ' - 'EXCLUDED.last_activity)' + 'last_activity, expires) = (EXCLUDED.enabled, EXCLUDED.last_packets, ' + 'EXCLUDED.last_activity, EXCLUDED.expires)' ) self.cur.execute( query, ( client.client_id, client.created, - client._ip_address, + client.ip_address, client.protocol, client.enabled, client.last_packets,