diff options
author | Rob Austein <sra@hactrn.net> | 2007-09-25 23:56:17 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-09-25 23:56:17 +0000 |
commit | ac9f0ad538da80e5397bc6bd46e74e336be96f8c (patch) | |
tree | 97fc40989de88479fd7c8efa4a5a33936651f2cd /scripts | |
parent | 9dbb0fecd60bda5f7ae600d9e0c0f6798cad2cec (diff) |
Rewrite to use ca_detail.status now that it's available
svn path=/scripts/rpki/up_down.py; revision=1035
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/rpki/up_down.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/scripts/rpki/up_down.py b/scripts/rpki/up_down.py index f8fe7f5d..8a05912c 100644 --- a/scripts/rpki/up_down.py +++ b/scripts/rpki/up_down.py @@ -135,13 +135,8 @@ class class_elt(base_elt): return elt def cons_resource_class(gctx, now, child, ca_id, irdb_as, irdb_v4, irdb_v6): - ca_detail = None - for c in rpki.sql.ca_detail_elt.sql_fetch_where(gctx.db, gctx.cur, "ca_id = %s" % ca_id): - if c.latest_ca_cert is not None and \ - c.latest_ca_cert.getNotBefore() <= now and \ - c.latest_ca_cert.getNotAfter() >= now and \ - (ca_detail is None or c.latest_ca_cert.getNotBefore() > ca_detail.latest_ca_cert.getNotBefore()): - ca_detail = c + ca_detail = rpki.sql.ca_detail_elt.sql_fetch_where(gctx.db, gctx.cur, "ca_id = %s AND status = 'active'" % ca_id) + assert len(ca_detail) < 2, "Found more than one 'active' ca_detail record, this should not happen!" if not ca_detail: return None rc_as, rc_v4, rc_v6 = ca_detail.latest_ca_cert.get_3779resources(irdb_as, irdb_v4, irdb_v6) |