summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-11-25 14:51:29 +0100
committerLinus Nordberg <linus@nordu.net>2016-11-25 14:51:46 +0100
commit797850d9b28084069085fb0629e763dffedc3d8a (patch)
tree9a187d9e6d4920cf883873fbba4fc71cdcd35c0a /tools
parentd8ce0c149f10d841dc19cbc32c8fc844aa4d65fb (diff)
Do import datetime even more.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/storagegc.py3
-rwxr-xr-xtools/submitcert.py5
-rwxr-xr-xtools/verifysct.py5
3 files changed, 8 insertions, 5 deletions
diff --git a/tools/storagegc.py b/tools/storagegc.py
index a4f15b7..4bfbad5 100755
--- a/tools/storagegc.py
+++ b/tools/storagegc.py
@@ -10,6 +10,7 @@ import json
import base64
import sys
import yaml
+from datetime import datetime
from certtools import *
parser = argparse.ArgumentParser(description='')
@@ -48,7 +49,7 @@ def verifyleafhash(leaf_hash):
return True
-starttime = datetime.datetime.now()
+starttime = datetime.now()
try:
diff --git a/tools/submitcert.py b/tools/submitcert.py
index c443cf4..3b10df5 100755
--- a/tools/submitcert.py
+++ b/tools/submitcert.py
@@ -14,6 +14,7 @@ import hashlib
import itertools
from certtools import *
from precerttools import *
+from datetime import datetime
import os
import signal
import select
@@ -195,7 +196,7 @@ else:
if args.pre_warm:
select.select([], [], [], 3.0)
-starttime = datetime.datetime.now()
+starttime = datetime.now()
try:
for result, timing in p.imap_unordered(submitcert, certs):
@@ -211,7 +212,7 @@ try:
save_sct(sct, sth, leafcert, issuer_key_hash)
else:
errors += 1
- deltatime = datetime.datetime.now() - starttime
+ deltatime = datetime.now() - starttime
deltatime_f = deltatime.seconds + deltatime.microseconds / 1000000.0
rate = nsubmitted / deltatime_f
if nsubmitted > lastprinted + ncerts / 10:
diff --git a/tools/verifysct.py b/tools/verifysct.py
index 71ea4e9..10f1672 100755
--- a/tools/verifysct.py
+++ b/tools/verifysct.py
@@ -13,6 +13,7 @@ import struct
import hashlib
import itertools
from certtools import *
+from datetime import datetime
import os
import signal
import select
@@ -98,7 +99,7 @@ scts = (json.loads(row) for row in sctfile)
nverified = 0
lastprinted = 0
-starttime = datetime.datetime.now()
+starttime = datetime.now()
try:
for result, timing in p.imap_unordered(verifysct, scts):
@@ -110,7 +111,7 @@ try:
sys.exit(1)
if result != None:
nverified += 1
- deltatime = datetime.datetime.now() - starttime
+ deltatime = datetime.now() - starttime
deltatime_f = deltatime.seconds + deltatime.microseconds / 1000000.0
rate = nverified / deltatime_f
if nverified > lastprinted + 100: