diff options
Diffstat (limited to 'monitor/josef_leveldb.py')
| -rwxr-xr-x | monitor/josef_leveldb.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/monitor/josef_leveldb.py b/monitor/josef_leveldb.py index e5bf581..5a8917b 100755 --- a/monitor/josef_leveldb.py +++ b/monitor/josef_leveldb.py @@ -35,6 +35,7 @@ def db_open(fn='./cert_db'): return db def db_append(db, key, val): + # print "Appending " + val if db is None: print "ERROR: NO DATABASE SET!" return @@ -43,12 +44,16 @@ def db_append(db, key, val): tmp = db.Get(key) except KeyError: tmp = "" + # print "Key: ", key, "Val: ", val, "Found: ", tmp tmpl = tmp.split(SEP) if val in tmpl: pass else: + # print tmpl tmpl.append(val) + # print tmpl db.Put(key,SEP.join(tmpl)) + # print "Storing " + SEP.join(tmpl) def db_add_domain(db, domain, data): if db is None: @@ -80,7 +85,7 @@ def db_add_certs(db, data): try: for line in cert["SAN"].split("DNS:")[1:]: db_add_domain(db, line, str(cert)) - except IndexError: + except IndexError, KeyError: pass @@ -105,7 +110,7 @@ def db_lookup_domain(db, domain): next_level = [] for item in intermediate: if match_domain(cur_domain, item): - print item + # print item try: tmp = db.Get(item) if tmp[1] == '{': |
