summaryrefslogtreecommitdiff
path: root/monitor/josef_monitor.py
diff options
context:
space:
mode:
authorJosef Gustafsson <josef.gson@gmail.com>2015-09-29 16:12:04 +0200
committerJosef Gustafsson <josef.gson@gmail.com>2015-09-29 16:12:04 +0200
commit9a8557ebf15d61661b621c559aabecddeb5b6a08 (patch)
tree39ac24a33a8fd6d063c7786c7b462db42ee5ece9 /monitor/josef_monitor.py
parent3ce97b21e8efe2432f3b4fcbd494c4b9560341fb (diff)
minor fixes
Diffstat (limited to 'monitor/josef_monitor.py')
-rwxr-xr-xmonitor/josef_monitor.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/monitor/josef_monitor.py b/monitor/josef_monitor.py
index a32cf7d..d9b65a1 100755
--- a/monitor/josef_monitor.py
+++ b/monitor/josef_monitor.py
@@ -49,6 +49,15 @@ class ctlog:
self.root_hash = None
self.build = build
+ if CONFIG.DB_PATH:
+ self.dbdir = CONFIG.DB_PATH
+ # self.dbdir = CONFIG.DB_PATH + name + "/"
+ if not os.path.exists(self.dbdir):
+ os.makedirs(self.dbdir)
+
+ else:
+ self.dbdir = None
+
self.log("Starting monitor")
@@ -71,8 +80,9 @@ class ctlog:
if self.entries != start_size:
if verify_subtree(self.sth, self.subtree, self.url):
- self.log("Successfully build tree with " + str(self.entries - start_size) + \
- " new entries. Size: " + str(self.entries))
+ pass
+ # self.log("Successfully build tree with " + str(self.entries - start_size) + \
+ # " new entries. Size: " + str(self.entries))
else:
self.log("ERROR Failed to build tree from entries.")
@@ -88,8 +98,8 @@ class ctlog:
tmp_data["leaf_hash"] = base64.b64encode(entry_hash)
tmp_cert_data.append(tmp_data)
new_leafs.append(entry_hash)
- if CONFIG.DB_PATH:
- db_add_certs(CONFIG.DB_PATH, tmp_cert_data)
+ if self.dbdir:
+ db_add_certs(self.dbdir, tmp_cert_data)
if CONFIG.DEFAULT_CERT_FILE:
append_file(CONFIG.DEFAULT_CERT_FILE, tmp_cert_data)
subtree = reduce_tree(new_leafs, subtree)