From 889305befbbba05381a36f5fc834b651b9f7f083 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 21 Mar 2013 16:33:05 +0000 Subject: 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 --- rpkid/rpki/rpkid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'rpkid') 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): -- cgit v1.2.3