Skip to content

Commit

Permalink
Merge pull request bloomreach#82 from apbodnar/add_endpoint_option
Browse files Browse the repository at this point in the history
allow for s3 endpoint param
  • Loading branch information
rozuur authored May 15, 2018
2 parents 0b3ca65 + 64c9065 commit 127f941
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ seconds to sleep between retries
##### `-c NUM_THREADS, --num-threads=NUM_THREADS`
number of concurrent threads

##### `--endpoint-url`
endpoint url used in boto3 client

##### `-d, --show-directory`
show directory instead of its content

Expand Down
8 changes: 6 additions & 2 deletions s4cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,10 @@ def __init__(self, opt, aws_access_key_id=None, aws_secret_access_key=None):
if (aws_access_key_id is not None) and (aws_secret_access_key is not None):
self.client = self.boto3.client('s3',
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key)
aws_secret_access_key=aws_secret_access_key,
endpoint_url=opt.endpoint_url)
else:
self.client = self.boto3.client('s3')
self.client = self.boto3.client('s3', endpoint_url=opt.endpoint_url)

# Cache the result so we don't have to recalculate.
self.legal_params = {}
Expand Down Expand Up @@ -1838,6 +1839,9 @@ def check_dict(self, opt, value):
parser.add_option(
'--ignore-empty-source', help='ignore empty source from s3',
dest='ignore_empty_source', action='store_true', default=False)
parser.add_option(
'--endpoint-url', help='configure boto3 to use a different s3 endpoint',
dest='endpoint_url', type='string', default=None)
parser.add_option(
'--use-ssl', help='(obsolete) use SSL connection to S3', dest='use_ssl',
action='store_true', default=False)
Expand Down

0 comments on commit 127f941

Please sign in to comment.