1
0
mirror of https://github.com/mail-in-a-box/mailinabox.git synced 2024-12-24 07:37:04 +00:00

fix non-pythonic things

This commit is contained in:
Joshua Tauberer 2024-12-22 07:25:20 -05:00 committed by GitHub
parent 03b3456799
commit 3dabaf1f81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -512,13 +512,13 @@ def list_target_files(config):
# connect to the region & bucket
try:
if (config['target_user'] == '') and (config['target_pass'] == ''):
## User did not specify an S3 Access Key, nor a S3 Secret Access Key. Perhaps using EC2 instance role?
s3 = boto3.client('s3', \
# User did not specify an S3 Access Key, nor a S3 Secret Access Key. Perhaps using EC2 instance role?
s3 = boto3.client('s3',
endpoint_url=f'https://{target.hostname}')
else:
s3 = boto3.client('s3', \
endpoint_url=f'https://{target.hostname}', \
aws_access_key_id=config['target_user'], \
s3 = boto3.client('s3',
endpoint_url=f'https://{target.hostname}',
aws_access_key_id=config['target_user'],
aws_secret_access_key=config['target_pass'])
bucket_objects = s3.list_objects_v2(Bucket=bucket, Prefix=path)['Contents']
backup_list = [(key['Key'][len(path):], key['Size']) for key in bucket_objects]