From a546e8bf44b89b170a01244e9cf65c46e79a2da5 Mon Sep 17 00:00:00 2001 From: Edoardo Putti Date: Fri, 23 Sep 2016 16:01:50 +0200 Subject: [PATCH] make CALookup iterable --- ca_manager.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ca_manager.py b/ca_manager.py index ece7464..7f49e36 100755 --- a/ca_manager.py +++ b/ca_manager.py @@ -185,6 +185,11 @@ class CALookup(object): self.ssl_ca_dir = ssl_ca_dir def __iter__(self): + c = self.conn.cursor() + + c.execute("""SELECT id, name, type FROM cas""") + + return iter(c.fetchall()) def __delitem__(self, ca_id): """