mirror of
https://github.com/adulau/crl-monitor.git
synced 2024-11-21 17:47:09 +00:00
Verbose output of the data store
This commit is contained in:
parent
85a38ee238
commit
28c6ea71c4
1 changed files with 8 additions and 2 deletions
|
@ -75,12 +75,17 @@ for cert in fileinput.input(args.r):
|
||||||
if not os.path.exists(p):
|
if not os.path.exists(p):
|
||||||
os.makedirs(p)
|
os.makedirs(p)
|
||||||
fn = os.path.join(p, fp)
|
fn = os.path.join(p, fp)
|
||||||
if not os.path.exists(fn):
|
if args.v:
|
||||||
|
print (fn)
|
||||||
|
if not os.path.exists(fn):
|
||||||
f = open(fn, 'w+')
|
f = open(fn, 'w+')
|
||||||
f.write(certb)
|
f.write(certb)
|
||||||
f.close()
|
f.close()
|
||||||
if args.v:
|
if args.v:
|
||||||
print "Certificate saved in "+fn
|
print "Certificate saved in "+fn
|
||||||
|
else:
|
||||||
|
if args.v:
|
||||||
|
print fn + " certificate already stored"
|
||||||
|
|
||||||
try:
|
try:
|
||||||
x509 = X509.load_cert_string(certb, X509.FORMAT_DER)
|
x509 = X509.load_cert_string(certb, X509.FORMAT_DER)
|
||||||
|
@ -95,7 +100,8 @@ for cert in fileinput.input(args.r):
|
||||||
if args.i:
|
if args.i:
|
||||||
writer.update_document(path=unicode(fp), content=unicode(subject)+" "+unicode(issuer))
|
writer.update_document(path=unicode(fp), content=unicode(subject)+" "+unicode(issuer))
|
||||||
elif args.s:
|
elif args.s:
|
||||||
r.sadd(fp, subject)
|
print (fp)
|
||||||
|
r.sadd(fp, subject)
|
||||||
else:
|
else:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue