summaryrefslogtreecommitdiff
path: root/monitor/josef_leveldb.py
diff options
context:
space:
mode:
Diffstat (limited to 'monitor/josef_leveldb.py')
-rwxr-xr-xmonitor/josef_leveldb.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/monitor/josef_leveldb.py b/monitor/josef_leveldb.py
index 769f6f3..fa948ed 100755
--- a/monitor/josef_leveldb.py
+++ b/monitor/josef_leveldb.py
@@ -12,6 +12,9 @@ SEP = ";"
dbs = {}
+
+
+
def match_domain(d1, d2):
# Exact match
if d1 == d2:
@@ -34,6 +37,7 @@ def match_domain(d1, d2):
def db_open(fn='./cert_db'):
+ print "Opening " + fn
global dbs
if fn in dbs:
return dbs[fn]
@@ -43,6 +47,11 @@ def db_open(fn='./cert_db'):
dbs[fn] = db
return db
+def db_close():
+ print "Closing databases."
+ for db in dbs:
+ del db
+
def db_append(db, key, val):
if db is None:
print "ERROR: NO DATABASE SET!"
@@ -112,6 +121,7 @@ def db_add_certs(db_dir, data):
pass
except IndexError:
pass
+ db_close()
def db_lookup_domain(db_dir, domain):