From b0d6a679cf388aaaa038b8aaf56a089c733b37ff Mon Sep 17 00:00:00 2001 From: Michael Elkins Date: Thu, 5 Jul 2012 18:09:58 +0000 Subject: check expiration of BSC's for each handle as well. display expiration dates and object types in verbose mode svn path=/trunk/; revision=4577 --- rpkid/portal-gui/scripts/rpkigui-check-expired.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'rpkid/portal-gui/scripts/rpkigui-check-expired.py') diff --git a/rpkid/portal-gui/scripts/rpkigui-check-expired.py b/rpkid/portal-gui/scripts/rpkigui-check-expired.py index 506e2556..b25b6e59 100644 --- a/rpkid/portal-gui/scripts/rpkigui-check-expired.py +++ b/rpkid/portal-gui/scripts/rpkigui-check-expired.py @@ -32,14 +32,22 @@ expire_time = now + datetime.timedelta(expire_days) Verbose = False +def check_bscs(conf, x): + for p in x: + t = p.certificate.getNotAfter() + if Verbose or t <= expire_time: + e = 'expired' if t <= now else 'will expire' + print "%s's BSC %s on %s" % (conf.handle, e, t) + + def check_cross_cert_expired(conf, x): for p in x: t = p.ta.getNotAfter() - if t <= expire_time: + if Verbose or t <= expire_time: e = 'expired' if t <= now else 'will expire' print "%s's TA for %s %s %s on %s" % (conf.handle, p.__class__.__name__, p.handle, e, t) t = p.certificate.getNotAfter() - if t <= expire_time: + if Verbose or t <= expire_time: e = 'expired' if t <= now else 'will expire' print "%s's cross cert for %s %s %s on %s" % (conf.handle, p.__class__.__name__, p.handle, e, t) @@ -87,6 +95,7 @@ Verbose = options.verbose # check expiration of certs for all handles managed by the web portal for h in Conf.objects.all(): + check_bscs(h, h.bscs.all()) check_cross_cert_expired(h, h.parents.all()) check_cross_cert_expired(h, h.children.all()) check_cross_cert_expired(h, h.repositories.all()) -- cgit v1.2.3