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',
endpoint_url='https://minio-osdu-minio.osdu-qa-16x64-ba8e38d4c011d627379af1a4280c4e35-0000.sjc03.containers.appdomain.cloud/',
aws_access_key_id='minio',
aws_secret_access_key='8482d131-c283-4684-aaca-6bf36008ed71',
......@@ -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
else:
raise FileNotFound(filename)
......@@ -49,7 +49,7 @@ class IBMBundleStorageClient(BundleStorageClient):
def upload_file(self, name: str, file: FileLikeObject) -> str:
try:
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