From ad4abbbd5a7a9da431752a80cbe5cc9caf444aea Mon Sep 17 00:00:00 2001 From: Joshua Hesketh Date: Tue, 31 Jul 2018 17:59:55 +1000 Subject: [PATCH] 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 --- .../library/zuul_swift_upload.py | 21 ++++++------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/roles/wip-upload-logs-swift/library/zuul_swift_upload.py b/roles/wip-upload-logs-swift/library/zuul_swift_upload.py index 587e20168..98bc30eb7 100755 --- a/roles/wip-upload-logs-swift/library/zuul_swift_upload.py +++ b/roles/wip-upload-logs-swift/library/zuul_swift_upload.py @@ -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(