From b91d30bffb55e1aab28ec7acbaa7283835089431 Mon Sep 17 00:00:00 2001 From: Stefan Midjich Date: Fri, 29 Sep 2017 19:06:02 +0200 Subject: [PATCH] giving up on the cursor thing --- tools/purge_clients.py | 5 +---- tools/storage.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tools/purge_clients.py b/tools/purge_clients.py index 0f8bf42..7cf7e62 100644 --- a/tools/purge_clients.py +++ b/tools/purge_clients.py @@ -31,10 +31,7 @@ config.readfp(args.config) sr = StoragePostgres(config=config) -# Get cursor from psycopg2 -client_ids = sr.client_ids() - -for client_id in client_ids: +for (client_id) in sr.client_ids(): client = Client( storage=sr, chain=config.get('iptables', 'chain'), diff --git a/tools/storage.py b/tools/storage.py index 7efa443..0f3658b 100644 --- a/tools/storage.py +++ b/tools/storage.py @@ -37,7 +37,7 @@ class StoragePostgres(object): self.cur.execute( 'select client_id from client' ) - return self.cur + return self.cur.fetchall() def get_client_by_id(self, client_id):