From bb9df66b81ca8d945b286e3340a200ccba44a751 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Wed, 23 Jul 2014 15:49:27 +0000 Subject: Finish first cut at RRDP test unpacking tool, shake a few bugs out of RRDP publication code. svn path=/branches/tk705/; revision=5907 --- rpki/pubd.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'rpki/pubd.py') diff --git a/rpki/pubd.py b/rpki/pubd.py index 1849a0dd..21fd9298 100644 --- a/rpki/pubd.py +++ b/rpki/pubd.py @@ -428,9 +428,10 @@ class delta_obj(rpki.sql.sql_persistent): self.sql_mark_dirty() def publish(self, client, der, uri, hash): - if hash is not None: - self.withdraw(client, uri, hash) - elif object_obj.current_object_at_uri(client, self, uri) is not None: + obj = object_obj.current_object_at_uri(client, self, uri) + if obj is not None and obj.hash == hash: + obj.delete(self) + elif obj is not None: raise rpki.exceptions.ExistingObjectAtURI("Object already published at %s" % uri) logger.debug("Publishing %s", uri) object_obj.create(client, self, der, uri) -- cgit v1.2.3