projects
/
certmaster.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make the sha import use hashlib and make the hashlib import work sanely
[certmaster.git]
/
scripts
/
certmaster-sync
diff --git
a/scripts/certmaster-sync
b/scripts/certmaster-sync
index
bd27af5
..
fd1db93
100644
(file)
--- a/
scripts/certmaster-sync
+++ b/
scripts/certmaster-sync
@@
-7,7
+7,19
@@
import os
import sys
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
import xmlrpclib
from glob import glob
from time import sleep
@@
-72,7
+84,7
@@
def local_certs():
return results
def checksum(f):
return results
def checksum(f):
- thissum =
sha.new(
)
+ thissum =
hashlib.new('sha1'
)
if os.path.exists(f):
fo = open(f, 'r')
data = fo.read()
if os.path.exists(f):
fo = open(f, 'r')
data = fo.read()