aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-10-08 19:35:44 +0000
committerRob Austein <sra@hactrn.net>2007-10-08 19:35:44 +0000
commit90a07280c4e7fa78cade25999266d91c08879ad1 (patch)
tree4d1ca2e07647e1653335d8588187a1313576c215
parent53cea30ed06c88d81f3b261650936932c2dd0512 (diff)
SIA construction
svn path=/scripts/rpki/sql.py; revision=1118
-rw-r--r--scripts/rpki/sql.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py
index 490780b0..c9b53d3b 100644
--- a/scripts/rpki/sql.py
+++ b/scripts/rpki/sql.py
@@ -175,6 +175,17 @@ class ca_obj(sql_persistant):
sql_template = template("ca", "ca_id", "last_crl_sn", "next_crl_update", "last_issued_sn", "last_manifest_sn", "next_manifest_update", "sia_uri", "parent_id")
+ def select_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.
+ """
+ repository = rpki.left_right.repository_elt.sql_fetch(gctx, parent.repository_id)
+ sia_dir = rc.suggested_sia_head and rc.suggested_sia_head.rsync()
+ if not sia_dir or not sia_dir.startswith(repository.sia_base) or not sia_dir.endswith("/"):
+ sia_dir = repository.sia_base
+ self.sia_uri = sia_dir + str(self.ca_id) + "/"
+ self.sql_mark_dirty()
+
def check_for_updates(self, gctx, parent, rc):
"""Parent has signaled continued existance of a resource class we
already knew about, so we need to check for an updated