summaryrefslogtreecommitdiff
path: root/backup
diff options
context:
space:
mode:
authorLingxian Kong <anlin.kong@gmail.com>2020-09-17 11:32:44 +1200
committerLingxian Kong <anlin.kong@gmail.com>2020-09-17 11:32:44 +1200
commit7537b3255e6a66ec778d51e48bb7451d66c12b99 (patch)
treecd1d1e5e4b759703b7b41b683f14590930b1bad3 /backup
parent38977368bee614f16451495d0243f3b485ca6fd1 (diff)
downloadtrove-7537b3255e6a66ec778d51e48bb7451d66c12b99.tar.gz
[Backup] Ignore 404 error when deleting swift objects
Change-Id: I32c6ad56ebbd77dbafb2f956c78082b944fc5a22
Diffstat (limited to 'backup')
-rw-r--r--backup/storage/swift.py8
1 files changed, 6 insertions, 2 deletions
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']