X-Git-Url: https://pwan.org/git/?p=certmaster.git;a=blobdiff_plain;f=scripts%2Fcertmaster-sync;fp=scripts%2Fcertmaster-sync;h=fd1db93defa429c4319a06745e08d8f24b72e49c;hp=bd27af51febdd184eb4930a6c57bdecaefdb1969;hb=5bdd42c1534a196d6be9104543e4a9a9b0442324;hpb=c6eb51dbc3be8ef1b97ad66ac5f218d5d48c9ec0 diff --git a/scripts/certmaster-sync b/scripts/certmaster-sync index bd27af5..fd1db93 100644 --- a/scripts/certmaster-sync +++ b/scripts/certmaster-sync @@ -7,7 +7,19 @@ import os import sys -import sha +try: + import hashlib +except ImportError: + # Python-2.4.z ... gah! (or even 2.3!) + import sha + class hashlib: + @staticmethod + def new(algo): + if algo == 'sha1': + return sha.new() + raise ValueError, "Bad checksum type" + + import xmlrpclib from glob import glob from time import sleep @@ -72,7 +84,7 @@ def local_certs(): return results def checksum(f): - thissum = sha.new() + thissum = hashlib.new('sha1') if os.path.exists(f): fo = open(f, 'r') data = fo.read()