Commit 4369a917 authored by jatinbhargav's avatar jatinbhargav
Browse files

read write policy changes

parent 1d89373e
Pipeline #112424 failed
......@@ -22,8 +22,8 @@ class IBMBundleStorageClient(BundleStorageClient):
self.client = get_client()
self.bucket_name = os.environ["POLICY_BUCKET"]
self.content_type = "application/x-gtar"
session = boto3.session.Session()
self.s3_client = session.client('s3',
# session = boto3.session.Session()
self.s3_client = boto3.resource('s3',
......@@ -38,7 +38,7 @@ class IBMBundleStorageClient(BundleStorageClient):
uri = self._get_bucket_uri(filename)
if self._does_file_exist(uri):
self._download_to_file(uri, file)
self.s3_client.download_file(uri, file, self.content_type)
return file, uri
raise FileNotFound(filename)
......@@ -49,7 +49,7 @@ class IBMBundleStorageClient(BundleStorageClient):
def upload_file(self, name: str, file: FileLikeObject) -> str:
uri = self._get_bucket_uri(name)
self.client.upload_file(uri, file, self.content_type)
self.s3_client.upload_file(uri, file, self.content_type)
return uri
except Exception as e:
logger.error(f"Failed to upload file to {uri}")
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment