summaryrefslogtreecommitdiff
path: root/swiftclient/service.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-07-07 22:21:38 +0000
committerGerrit Code Review <review@openstack.org>2015-07-07 22:21:38 +0000
commit92b82777523b0858d6f20fc49ea60f7edebb2dca (patch)
tree5d00aa2bad5187396f4bacbe5183168ed51251b5 /swiftclient/service.py
parent249dd1a393f5b75797f617f701ffcef714e9676a (diff)
parent794b125e76e8ab4798d777ec85c559fb0aa1e5d1 (diff)
downloadpython-swiftclient-92b82777523b0858d6f20fc49ea60f7edebb2dca.tar.gz
Merge "SwiftClient object upload beginning with / or "./""
Diffstat (limited to 'swiftclient/service.py')
-rw-r--r--swiftclient/service.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/swiftclient/service.py b/swiftclient/service.py
index ba21a49..d7c05ca 100644
--- a/swiftclient/service.py
+++ b/swiftclient/service.py
@@ -1599,6 +1599,10 @@ class SwiftService(object):
def _upload_object_job(self, conn, container, source, obj, options,
results_queue=None):
+ if obj.startswith('./') or obj.startswith('.\\'):
+ obj = obj[2:]
+ if obj.startswith('/'):
+ obj = obj[1:]
res = {
'action': 'upload_object',
'container': container,
@@ -1611,10 +1615,6 @@ class SwiftService(object):
path = source
res['path'] = path
try:
- if obj.startswith('./') or obj.startswith('.\\'):
- obj = obj[2:]
- if obj.startswith('/'):
- obj = obj[1:]
if path is not None:
put_headers = {'x-object-meta-mtime': "%f" % getmtime(path)}
else: