diff options
-rwxr-xr-x | monitor/josef_experimental.py | 42 |
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...") |