summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjosef <josef.gson@gmail.com>2015-12-09 09:05:26 +0100
committerjosef <josef.gson@gmail.com>2015-12-09 09:05:26 +0100
commit35f88aef708c1b59bf726962a41988772ad37114 (patch)
tree535e8088ccc3c2b81cadf3d2094b5e03dcfefa45
parent857a06f19b427f7fd9ef0a13b1da83e6df6100b1 (diff)
counting root overlap
-rwxr-xr-xmonitor/josef_experimental.py42
1 files changed, 42 insertions, 0 deletions
diff --git a/monitor/josef_experimental.py b/monitor/josef_experimental.py
index b40219f..31453ca 100755
--- a/monitor/josef_experimental.py
+++ b/monitor/josef_experimental.py
@@ -179,8 +179,50 @@ def email(s):
p.communicate(s)
+def list_roots():
+ logs = [
+ "rocketeer-roots",
+ "aviator-roots",
+ "pilot-roots",
+ "certly-roots",
+ "digicert-roots",
+ "izenpe-roots",
+ "symantec-roots",
+ "venafi-roots",
+ "wosign-roots",
+ "vega-roots",
+ ]
+ roots = []
+ # for log in os.listdir("./" + OUTPUT_DIR):
+ for log in logs:
+ # if path.endswith("-roots"):
+ # roots.append(log)
+ roots.append(os.listdir("./" + OUTPUT_DIR + log))
+ return roots
+
+def count_and_remove(item, listlist):
+ count = 0
+ for l in listlist:
+ if item in l:
+ count += 1
+ l.remove(item)
+ if len(l) == 0:
+ listlist.remove(l)
+ return count
+
if __name__ == '__main__':
+ if True:
+ all_roots = list_roots()
+ res = {1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:0}
+ while len(all_roots) != 0:
+ count = count_and_remove(all_roots[0][0],all_roots)
+ res[count] += 1
+
+ print res
+
+
+
# Test email
if False:
email("this is an automated test...")