Commit a5661dc0 authored by Klaus-Uwe Mitterer's avatar Klaus-Uwe Mitterer

Fix a stupid, stupid mistake

parent 135aa08a
......@@ -6,12 +6,13 @@ if __name__ == "__main__":
hosts = ast.literal_eval(setuptools.getSetting("SSL", "hosts"))
pbefore = int(setuptools.getSetting("SSL", "pbefore"))
pafter = int(setuptools.getSetting("SSL", "pafter"))
two = twitools.twObject()
for h in hosts:
expiry = ssltools.getRemoteExpiry(h[0], h[1])
diff = expiry - datetime.datetime.now()
if diff < datetime.timedelta(days=pbefore):
if expiry > datetime.datetime.now():
twitools.tweet("@%s %s certificate expiring soon (%s). Please renew." % (h[2], h[0], expiry))
two.tweet("@%s %s certificate expiring soon (%s). Please renew." % (h[2], h[0], expiry))
elif expiry + datetime.timedelta(days=pafter) < datetime.datetime.now():
twitools.tweet("@%s %s certificate has expired! (%s) Please renew ASAP!" % (h[2], h[0], expiry))
two.tweet("@%s %s certificate has expired! (%s) Please renew ASAP!" % (h[2], h[0], expiry))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment