diff --git a/swiftclient/service.py b/swiftclient/service.py index df1ffb3..0f3bc5f 100644 --- a/swiftclient/service.py +++ b/swiftclient/service.py @@ -1494,6 +1494,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, @@ -1506,10 +1510,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: