Skip to content

Commit

Permalink
Update Boto Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
lbeckman314 committed Feb 29, 2024
1 parent 51f83fd commit d7f91d5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fence/resources/aws/boto_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@ def __init__(self, config, buckets, logger):
self.iam = None

def create_s3_clients(self, config, buckets):
s3_clients = {'default': self.s3_client}

s3_clients = {}
for bucket in buckets:
cred_name = buckets[bucket]['cred']
creds = {}
if cred_name != '*':
creds = config[cred_name]

if 'endpoint_url' in buckets[bucket]:
endpoint_url = buckets[bucket]['endpoint_url']
s3_clients[bucket] = client('s3', **creds, endpoint_url=endpoint_url)
Expand All @@ -44,7 +42,7 @@ def create_s3_clients(self, config, buckets):

def get_s3_client(self, bucket):
if self.s3_clients.get(bucket) is None:
return self.s3_clients['default']
return self.s3_clients[0]
return self.s3_clients[bucket]

def delete_data_file(self, bucket, prefix):
Expand Down

0 comments on commit d7f91d5

Please sign in to comment.