aboutsummaryrefslogtreecommitdiff
path: root/rpkid/rpki/rpkid.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2013-03-21 16:33:05 +0000
committerRob Austein <sra@hactrn.net>2013-03-21 16:33:05 +0000
commit889305befbbba05381a36f5fc834b651b9f7f083 (patch)
tree15f4feb725853026daa74ca34f1dd5cd3e3d2e0d /rpkid/rpki/rpkid.py
parent36a1352db66973374f0617a23b97845a3b326809 (diff)
Clean up if construct_sia_uri() throws an exception while we're
creating a CA object. We really ought to hold off on saving the CA to SQL until after constructing the URI, but we can't as long as URI includes the SQL ID (bletch). Enabling merge_publication_directories [4823] would fix this, but there may be a backwards compatabiilty issue to be resolved there first. Closes #46. svn path=/trunk/; revision=5195
Diffstat (limited to 'rpkid/rpki/rpkid.py')
-rw-r--r--rpkid/rpki/rpkid.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/rpkid/rpki/rpkid.py b/rpkid/rpki/rpkid.py
index ce815345..9594f668 100644
--- a/rpkid/rpki/rpkid.py
+++ b/rpkid/rpki/rpkid.py
@@ -624,7 +624,11 @@ class ca_obj(rpki.sql.sql_persistent):
self.parent_id = parent.parent_id
self.parent_resource_class = rc.class_name
self.sql_store()
- self.sia_uri = self.construct_sia_uri(parent, rc)
+ try:
+ self.sia_uri = self.construct_sia_uri(parent, rc)
+ except rpki.exceptions.BadURISyntax:
+ self.sql_delete()
+ raise
ca_detail = ca_detail_obj.create(self)
def done(issue_response):