diff options
author | Michael Elkins <melkins@tislabs.com> | 2012-07-05 18:09:58 +0000 |
---|---|---|
committer | Michael Elkins <melkins@tislabs.com> | 2012-07-05 18:09:58 +0000 |
commit | b0d6a679cf388aaaa038b8aaf56a089c733b37ff (patch) | |
tree | c2717c4ad8a4b83fcc6d9ae5483202562f634377 /rpkid/portal-gui/scripts/rpkigui-check-expired.py | |
parent | 01c0e17fa2893b76bde21c30b9fbe307d9ec21d3 (diff) |
check expiration of BSC's for each handle as well.
display expiration dates and object types in verbose mode
svn path=/trunk/; revision=4577
Diffstat (limited to 'rpkid/portal-gui/scripts/rpkigui-check-expired.py')
-rw-r--r-- | rpkid/portal-gui/scripts/rpkigui-check-expired.py | 13 |
1 files changed, 11 insertions, 2 deletions
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()) |