diff options
author | Rob Austein <sra@hactrn.net> | 2007-12-23 00:19:07 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-12-23 00:19:07 +0000 |
commit | b0a6072d09ed835464f941d741e29b76c6df58b5 (patch) | |
tree | 0a8726799739b6fdf9d65ea527ed3c113d72632a /scripts | |
parent | 8a65f4d8166d946a6a10fd4c869eb1b005d24879 (diff) |
Revocation and validity date changes appear to work now.
svn path=/scripts/rpki/sql.py; revision=1426
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/rpki/sql.py | 5 | ||||
-rwxr-xr-x | scripts/rpkid.py | 5 | ||||
-rw-r--r-- | scripts/testdb1.yaml | 18 |
3 files changed, 25 insertions, 3 deletions
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py index ffeca909..b461a38c 100644 --- a/scripts/rpki/sql.py +++ b/scripts/rpki/sql.py @@ -51,7 +51,9 @@ def sql_assert_pristine(): def sql_sweep(gctx): """Write any dirty objects out to SQL.""" for s in sql_dirty.copy(): + rpki.log.debug("Sweeping %s" % repr(s)) s.sql_store(gctx) + sql_assert_pristine() def fetch_column(gctx, *query): """Pull a single column from SQL, return it as a list.""" @@ -507,8 +509,10 @@ class ca_detail_obj(sql_persistant): child_id = child.child_id, ca_detail_id = self.ca_detail_id, cert = cert) + rpki.log.debug("Created new child_cert %s" % repr(child_cert)) else: child_cert.cert = cert + rpki.log.debug("Reusing existing child_cert %s" % repr(child_cert)) child_cert.ski = cert.get_SKI() @@ -597,6 +601,7 @@ class child_cert_obj(sql_persistant): def revoke(self): """Mark a child cert as revoked.""" if self.revoked is None: + rpki.log.debug("Revoking %s" % repr(self)) self.revoked = rpki.sundial.datetime.utcnow() self.sql_mark_dirty() diff --git a/scripts/rpkid.py b/scripts/rpkid.py index bd41ca67..cbfe1359 100755 --- a/scripts/rpkid.py +++ b/scripts/rpkid.py @@ -9,7 +9,7 @@ Default configuration file is rpkid.conf, override with --config option. """ import traceback, os, time, getopt, sys, MySQLdb, lxml.etree -import rpki.resource_set, rpki.up_down, rpki.left_right, rpki.x509 +import rpki.resource_set, rpki.up_down, rpki.left_right, rpki.x509, rpki.sql import rpki.https, rpki.config, rpki.cms, rpki.exceptions, rpki.relaxng, rpki.log def left_right_handler(query, path): @@ -23,6 +23,7 @@ def left_right_handler(query, path): r_elt = r_msg.toXML() rpki.relaxng.left_right.assertValid(r_elt) reply = rpki.cms.xml_sign(r_elt, gctx.cms_key, gctx.cms_certs) + rpki.sql.sql_sweep(gctx) return 200, reply except lxml.etree.DocumentInvalid: rpki.log.warning("Received reply document does not pass schema check: " + lxml.etree.tostring(r_elt, pretty_print = True)) @@ -43,6 +44,7 @@ def up_down_handler(query, path): if child is None: raise rpki.exceptions.ChildNotFound, "Could not find child %s" % child_id reply = child.serve_up_down(gctx, query) + rpki.sql.sql_sweep(gctx) return 200, reply except Exception, data: rpki.log.error(traceback.format_exc()) @@ -58,6 +60,7 @@ def cronjob_handler(query, path): s.client_poll(gctx) s.update_children(gctx) s.regenerate_crls_and_manifests(gctx) + rpki.sql.sql_sweep(gctx) return 200, "OK" class global_context(object): diff --git a/scripts/testdb1.yaml b/scripts/testdb1.yaml index 9b8929b7..17f3c199 100644 --- a/scripts/testdb1.yaml +++ b/scripts/testdb1.yaml @@ -15,5 +15,19 @@ kids: valid_until: 2009-07-14T12:30:00Z --- - name: Alice - add_as: 33 - valid_until: 2008-07-14T12:30:00Z + valid_until: 2009-04-01T00:00:00 +--- +- name: Alice + valid_until: 2009-07-14T12:30:00Z +--- +- name: Alice + valid_until: 2009-04-01T00:00:00 +--- +- name: Alice + valid_until: 2009-07-14T12:30:00Z +--- +- name: Alice + valid_until: 2009-04-01T00:00:00 +--- +- name: Alice + valid_until: 2009-07-14T12:30:00Z |