aboutsummaryrefslogtreecommitdiff
path: root/rpkid/portal-gui/scripts
diff options
context:
space:
mode:
authorMichael Elkins <melkins@tislabs.com>2012-07-05 18:30:00 +0000
committerMichael Elkins <melkins@tislabs.com>2012-07-05 18:30:00 +0000
commita63dd3cdd806f7a1b2e59ba385b24b7db931f646 (patch)
treefe25d29cd1fca31de01acbd9925d1361995725fc /rpkid/portal-gui/scripts
parentb0d6a679cf388aaaa038b8aaf56a089c733b37ff (diff)
print cached rescert information when we do not find the cert in the rcynic cache
svn path=/trunk/; revision=4578
Diffstat (limited to 'rpkid/portal-gui/scripts')
-rw-r--r--rpkid/portal-gui/scripts/rpkigui-check-expired.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/rpkid/portal-gui/scripts/rpkigui-check-expired.py b/rpkid/portal-gui/scripts/rpkigui-check-expired.py
index b25b6e59..8f7740b7 100644
--- a/rpkid/portal-gui/scripts/rpkigui-check-expired.py
+++ b/rpkid/portal-gui/scripts/rpkigui-check-expired.py
@@ -53,15 +53,15 @@ def check_cross_cert_expired(conf, x):
def check_expire(handle):
- if Verbose:
- print 'checking rescert expiration for %s' % handle
# get certs for `handle'
cert_set = ResourceCert.objects.filter(parent__issuer=handle)
for cert in cert_set:
# look up cert in cacheview db
obj_set = Cert.objects.filter(repo__uri=cert.uri)
if not obj_set:
- print >>sys.stderr, "Unable to locate rescert %s in rcynic cache" % cert.uri
+ # since the <list_received_resources/> output is cached, this can
+ # occur if the cache is out of date as well..
+ print "Unable to locate rescert in rcynic cache: handle=%s uri=%s not_after=%s" % (handle.handle, cert.uri, cert.not_after)
continue
obj = obj_set[0]
cert_list = cert_chain(obj)
@@ -74,9 +74,8 @@ def check_expire(handle):
else:
f = ' '
msg.append("%s [%d] uri=%s ski=%s name=%s expires=%s" % (f, n, c.repo.uri, c.keyid, c.name, c.not_after))
- if expired:
- print "Warning: resource cert for user %s will expire soon:\n"
if expired or Verbose:
+ print "%s's rescert from parent %s will expire soon:\n" % (handle.handle, cert.parent.handle)
print "Certificate chain:"
print "\n".join(msg)