summaryrefslogtreecommitdiff
path: root/swiftclient/service.py
diff options
context:
space:
mode:
authorTim Burke <tim.burke@gmail.com>2019-07-26 22:56:08 -0700
committerTim Burke <tim.burke@gmail.com>2019-08-01 20:42:31 -0700
commit78753987468cb6b04d0b4e06b432e22f5a7189bd (patch)
tree67a7363af5abd18dd11c557f2b0e47bf8c356455 /swiftclient/service.py
parent5bd66947fc3d8987d4b24d5119a346031004229e (diff)
downloadpython-swiftclient-78753987468cb6b04d0b4e06b432e22f5a7189bd.tar.gz
Delete/overwrite symlinks better
Previously, when deleting a symlink that points to an xLO, we'd clean up the xLO's segments then delete the symlink, leaving the xLO itself busted. Similar trouble would come from overwriting a symlink pointing to an xLO. Check for a Content-Location in the HEAD response and leave such segments. Co-Authored-By: Clay Gerrard <clay.gerrard@gmail.com> Change-Id: I45b210cf380a68bd88187c91fa2d63a8b2bb709b
Diffstat (limited to 'swiftclient/service.py')
-rw-r--r--swiftclient/service.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py
index 06de091..5292dc5 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -2070,7 +2070,8 @@ class SwiftService(object):
'status': 'skipped-changed'
})
return res
- if not options['leave_segments']:
+ if not options['leave_segments'] and not headers.get(
+ 'content-location'):
old_manifest = headers.get('x-object-manifest')
if is_slo:
old_slo_manifest_paths.extend(
@@ -2515,7 +2516,8 @@ class SwiftService(object):
if not options['leave_segments']:
try:
headers = conn.head_object(container, obj,
- headers=_headers)
+ headers=_headers,
+ query_string='symlink=get')
old_manifest = headers.get('x-object-manifest')
if config_true_value(headers.get('x-static-large-object')):
query_string = 'multipart-manifest=delete'