forgot expires here

This commit is contained in:
Stefan Midjich 2017-09-29 18:53:51 +02:00
parent a67d7f7a6d
commit 3f8d85d50b
2 changed files with 4 additions and 4 deletions

View File

@ -134,7 +134,7 @@ class Client(object):
def commit_rule(self): 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: if not rule:
rule = iptc.Rule() rule = iptc.Rule()
rule.src = self.ip_address rule.src = self.ip_address

View File

@ -66,15 +66,15 @@ class StoragePostgres(object):
'enabled, last_packets, last_activity, expires) values ' 'enabled, last_packets, last_activity, expires) values '
'(%s, %s, %s, %s, %s, %s, %s, %s) on conflict (client_id, ' '(%s, %s, %s, %s, %s, %s, %s, %s) on conflict (client_id, '
'ip_address, protocol) do update set (enabled, last_packets, ' 'ip_address, protocol) do update set (enabled, last_packets, '
'last_activity) = (EXCLUDED.enabled, EXCLUDED.last_packets, ' 'last_activity, expires) = (EXCLUDED.enabled, EXCLUDED.last_packets, '
'EXCLUDED.last_activity)' 'EXCLUDED.last_activity, EXCLUDED.expires)'
) )
self.cur.execute( self.cur.execute(
query, query,
( (
client.client_id, client.client_id,
client.created, client.created,
client._ip_address, client.ip_address,
client.protocol, client.protocol,
client.enabled, client.enabled,
client.last_packets, client.last_packets,