diff --git a/zuul_registry/swift.py b/zuul_registry/swift.py index 4c2a3f5..6c28282 100644 --- a/zuul_registry/swift.py +++ b/zuul_registry/swift.py @@ -152,9 +152,18 @@ class SwiftDriver(storageutils.StorageDriver): return size, ret.iter_content(chunk_size=SWIFT_CHUNK_SIZE) def delete_object(self, path): - retry_function( - lambda: self.conn.session.delete( - self.get_url(path))) + try: + retry_function( + lambda: self.conn.session.delete( + self.get_url(path))) + except keystoneauth1.exceptions.http.NotFound: + # We have seen instances where the swift object list is + # apparently not in sync with the backend. If we get a + # 404 when deleting an object, it will typically no longer + # show up in object lists after that, so we can safely + # ignore the error. Log it here so we have some + # visibility. + self.log.debug("NotFound error when deleting %s", path) def move_object(self, src_path, dst_path, uuid=None): dst = os.path.join(self.container_name, dst_path)