diff options
author | Rob Austein <sra@hactrn.net> | 2007-11-14 05:16:52 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-11-14 05:16:52 +0000 |
commit | 6250badbca17e4045d19406daff5e24b6ba66eca (patch) | |
tree | 2ec4b74cfe21f3c912852e3157225b32618d5d04 /scripts | |
parent | ff2aadafba1f06c36b92906f0ff6906b2af4cc87 (diff) |
Use correct types for timestamps
svn path=/scripts/rpki/sql.py; revision=1291
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/rpki/sql.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py index 88ba39d8..570fdee4 100644 --- a/scripts/rpki/sql.py +++ b/scripts/rpki/sql.py @@ -200,6 +200,13 @@ class ca_obj(sql_persistant): last_issued_sn = 0 last_manifest_sn = 0 + def sql_decode(self, vals): + """Decode SQL representation of a ca_obj.""" + sql_persistant.sql_decode(self, vals) + for i in ("next_crl_update", "next_manifest_update"): + if vals.get(i) is not None: + setattr(self, i, rpki.sundial.datetime.fromdatetime(vals[i])) + def construct_sia_uri(self, gctx, parent, rc): """Construct the sia_uri value for this CA given configured information and the parent's up-down protocol list_response PDU. @@ -320,6 +327,8 @@ class ca_detail_obj(sql_persistant): ("latest_crl", rpki.x509.CRL)): if getattr(self, i, None) is not None: setattr(self, i, t(DER = getattr(self, i))) + if vals.get("state_timer") is not None: + self.state_timer = rpki.sundial.datetime.fromdatetime(vals["state_timer"]) assert (self.public_key is None and self.private_key_id is None) or \ self.public_key.get_DER() == self.private_key_id.get_public_DER() assert (self.manifest_public_key is None and self.manifest_private_key_id is None) or \ |