Use endpoint_url in S3Backend

This commit is contained in:
Javier de la Puente 2024-04-17 09:44:19 +02:00 committed by Jeremy Stretch
parent 4284028bb0
commit c5ae89ad03
1 changed files with 7 additions and 1 deletions

View File

@ -149,7 +149,8 @@ class S3Backend(DataBackend):
region_name=self._region_name,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key,
config=self.config
config=self.config,
endpoint_url=self._endpoint_url
)
bucket = s3.Bucket(self._bucket_name)
@ -176,6 +177,11 @@ class S3Backend(DataBackend):
url_path = urlparse(self.url).path.lstrip('/')
return url_path.split('/')[0]
@property
def _endpoint_url(self):
url_path = urlparse(self.url)
return url_path._replace(params="", fragment="", query="", path="").geturl()
@property
def _remote_path(self):
url_path = urlparse(self.url).path.lstrip('/')