diff options
author | Rob Austein <sra@hactrn.net> | 2007-11-01 12:46:12 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2007-11-01 12:46:12 +0000 |
commit | 56a4ab2e45cf149c61f68428003050b423e15862 (patch) | |
tree | 7089576ca171a8c9d1148cdade1868687e7ed7ac | |
parent | 12feb50d0494ebbf33cd18b4c8974eebf2e20158 (diff) |
Checkpoint
svn path=/scripts/rpki/sql.py; revision=1226
-rw-r--r-- | scripts/rpki/sql.py | 9 | ||||
-rw-r--r-- | scripts/testroot.sh | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py index 7c389740..06f6907c 100644 --- a/scripts/rpki/sql.py +++ b/scripts/rpki/sql.py @@ -157,7 +157,7 @@ class sql_persistant(object): with no datatype conversion. If you need something fancier, override this. """ - return dict((a, getattr(self, a)) for a in self.sql_template.columns) + return dict((a, getattr(self, a, None)) for a in self.sql_template.columns) def sql_decode(self, vals): """Initialize an object with values returned by self.sql_fetch(). @@ -192,7 +192,8 @@ class ca_obj(sql_persistant): """Internal CA object.""" 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") + "last_manifest_sn", "next_manifest_update", "sia_uri", "parent_id", + "parent_resource_class") def construct_sia_uri(self, gctx, parent, rc): """Construct the sia_uri value for this CA given configured @@ -200,8 +201,8 @@ class ca_obj(sql_persistant): """ repository = rpki.left_right.repository_elt.sql_fetch(gctx, parent.repository_id) sia_uri = rc.suggested_sia_head and rc.suggested_sia_head.rsync() - if not sia_uri or not sia_uri.startswith(repository.sia_base): - sia_uri = repository.sia_base + if not sia_uri or not sia_uri.startswith(parent.sia_base): + sia_uri = parent.sia_base elif not sia_uri.endswith("/"): raise rpki.exceptions.BadURISyntax, "SIA URI must end with a slash: %s" % sia_uri return sia_uri + str(self.ca_id) + "/" diff --git a/scripts/testroot.sh b/scripts/testroot.sh index e107621e..b7de13de 100644 --- a/scripts/testroot.sh +++ b/scripts/testroot.sh @@ -47,7 +47,8 @@ python irbe-cli.py repository --self_id 1 --action create --bsc_id 1 python irbe-cli.py parent --self_id 1 --action create --bsc_id 1 --repository_id 1 \ --peer_contact_uri https://localhost:44333/ \ --cms_ta biz-certs/Elena-Root.cer \ - --https_ta biz-certs/Elena-Root.cer + --https_ta biz-certs/Elena-Root.cer \ + --sia_base rsync://wombat.invalid/ # Shut down rpkid (there should be a left-right command for this!) |