From 7537b3255e6a66ec778d51e48bb7451d66c12b99 Mon Sep 17 00:00:00 2001 From: Lingxian Kong Date: Thu, 17 Sep 2020 11:32:44 +1200 Subject: [Backup] Ignore 404 error when deleting swift objects Change-Id: I32c6ad56ebbd77dbafb2f956c78082b944fc5a22 --- backup/storage/swift.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'backup') diff --git a/backup/storage/swift.py b/backup/storage/swift.py index 8c60cb56..f3fd10d3 100644 --- a/backup/storage/swift.py +++ b/backup/storage/swift.py @@ -214,8 +214,12 @@ class SwiftStorage(base.Storage): # Delete the old segment file that was copied LOG.info('Deleting the old segment file %s.', stream_reader.first_segment) - self.client.delete_object(container, - stream_reader.first_segment) + try: + self.client.delete_object(container, + stream_reader.first_segment) + except swiftclient.exceptions.ClientException as e: + if e.http_status != 404: + raise final_swift_checksum = segment_result['etag'] -- cgit v1.2.1