aboutsummaryrefslogtreecommitdiff
path: root/rpki
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2014-07-23 15:49:27 +0000
committerRob Austein <sra@hactrn.net>2014-07-23 15:49:27 +0000
commitbb9df66b81ca8d945b286e3340a200ccba44a751 (patch)
tree12d135599f12d8d4bf4b71d3459ab70ce306f7c7 /rpki
parent774acaf3c0553d3d8252752dda4a02073b3dd56e (diff)
Finish first cut at RRDP test unpacking tool, shake a few bugs out of
RRDP publication code. svn path=/branches/tk705/; revision=5907
Diffstat (limited to 'rpki')
-rw-r--r--rpki/pubd.py7
1 files changed, 4 insertions, 3 deletions
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)