From: Stephen Soltesz Date: Mon, 7 Dec 2009 23:04:38 +0000 (+0000) Subject: report any expired sites & nodes X-Git-Tag: Monitor-3.0-26~5 X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=commitdiff_plain;h=328ee7b92f4e23570d8a33ad9244413ae3aee6bf report any expired sites & nodes --- diff --git a/blacklist.py b/blacklist.py index 3ff769f..34745c8 100755 --- a/blacklist.py +++ b/blacklist.py @@ -43,8 +43,9 @@ def main(): loginbases_q = BlacklistRecord.getLoginbaseBlacklist() hostnames = [ h.hostname for h in hostnames_q ] loginbases = [ h.loginbase for h in loginbases_q ] - hostnames_exp = [ (h.hostname,h.date_created+timedelta(0,h.expires)) for h in hostnames_q ] - loginbases_exp = [ (h.loginbase,h.date_created+timedelta(0,h.expires)) for h in loginbases_q ] + hostnames_exp = [ (h.hostname,h.date_created+timedelta(0,h.expires),h.date_created+timedelta(0,h.expires) < datetime.now() and h.expires != 0) for h in hostnames_q ] + #loginbases_exp = [ (h.loginbase,h.date_created+timedelta(0,h.expires)) for h in loginbases_q ] + loginbases_exp = [ (h.loginbase,h.date_created+timedelta(0,h.expires),h.date_created+timedelta(0,h.expires) < datetime.now() and h.expires != 0) for h in loginbases_q ] if config.add: print "Blacklisting nodes: ", l_nodes @@ -78,7 +79,9 @@ def main(): objlist = hostnames_exp for i in objlist: - if i[1] > datetime.now(): + if i[2]: + print i[0], i[1], "<-- expired" + elif i[1] > datetime.now(): print i[0], i[1] else: print i[0]