Remove unused code path in zuul_swift_upload
I'm not sure if this was being kept around for any particular reason, but since it is unused I'm assuming we can remove it. If not, we should move USE_SHADE to a global up the top. Change-Id: I8b82531e6a994d00459e0e7883fac2588d91c17e
This commit is contained in:
parent
e86c2bb4fb
commit
ad4abbbd5a
@ -420,8 +420,6 @@ class Uploader(object):
|
|||||||
headers['x-delete-after'] = str(self.delete_after)
|
headers['x-delete-after'] = str(self.delete_after)
|
||||||
headers['content-type'] = file_detail.mimetype
|
headers['content-type'] = file_detail.mimetype
|
||||||
|
|
||||||
USE_SHADE = True
|
|
||||||
|
|
||||||
for attempt in range(1, POST_RETRIES + 1):
|
for attempt in range(1, POST_RETRIES + 1):
|
||||||
try:
|
try:
|
||||||
if not file_detail.folder:
|
if not file_detail.folder:
|
||||||
@ -436,19 +434,12 @@ class Uploader(object):
|
|||||||
else:
|
else:
|
||||||
data = ''
|
data = ''
|
||||||
relative_path = relative_path.rstrip('/')
|
relative_path = relative_path.rstrip('/')
|
||||||
if USE_SHADE:
|
|
||||||
if relative_path == '':
|
if relative_path == '':
|
||||||
relative_path = '/'
|
relative_path = '/'
|
||||||
if USE_SHADE:
|
|
||||||
self.cloud.create_object(self.container,
|
self.cloud.create_object(self.container,
|
||||||
name=relative_path,
|
name=relative_path,
|
||||||
data=data,
|
data=data,
|
||||||
**headers)
|
**headers)
|
||||||
else:
|
|
||||||
self.cloud.object_store.put(
|
|
||||||
os.path.join('/', self.container, relative_path),
|
|
||||||
data=data,
|
|
||||||
headers=headers)
|
|
||||||
break
|
break
|
||||||
except requests.exceptions.RequestException:
|
except requests.exceptions.RequestException:
|
||||||
logging.exception(
|
logging.exception(
|
||||||
|
Loading…
Reference in New Issue
Block a user