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:
Joshua Hesketh 2018-07-31 17:59:55 +10:00
parent e86c2bb4fb
commit ad4abbbd5a

View File

@ -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 = '/' self.cloud.create_object(self.container,
if USE_SHADE: name=relative_path,
self.cloud.create_object(self.container, data=data,
name=relative_path, **headers)
data=data,
**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(