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
1 changed files with 6 additions and 15 deletions

View File

@ -420,8 +420,6 @@ class Uploader(object):
headers['x-delete-after'] = str(self.delete_after)
headers['content-type'] = file_detail.mimetype
USE_SHADE = True
for attempt in range(1, POST_RETRIES + 1):
try:
if not file_detail.folder:
@ -436,19 +434,12 @@ class Uploader(object):
else:
data = ''
relative_path = relative_path.rstrip('/')
if USE_SHADE:
if relative_path == '':
relative_path = '/'
if USE_SHADE:
self.cloud.create_object(self.container,
name=relative_path,
data=data,
**headers)
else:
self.cloud.object_store.put(
os.path.join('/', self.container, relative_path),
data=data,
headers=headers)
if relative_path == '':
relative_path = '/'
self.cloud.create_object(self.container,
name=relative_path,
data=data,
**headers)
break
except requests.exceptions.RequestException:
logging.exception(