[Backup] Ignore 404 error when deleting swift objects

Change-Id: I32c6ad56ebbd77dbafb2f956c78082b944fc5a22
This commit is contained in:
Lingxian Kong 2020-09-17 11:32:44 +12:00
parent 38977368be
commit 7537b3255e
1 changed files with 6 additions and 2 deletions

View File

@ -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']