Skip to content

Commit c5ae89a

Browse files
javierdelapuentejeremystretch
authored andcommitted
Use endpoint_url in S3Backend
1 parent 4284028 commit c5ae89a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

netbox/core/data_backends.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ def fetch(self):
149149
region_name=self._region_name,
150150
aws_access_key_id=aws_access_key_id,
151151
aws_secret_access_key=aws_secret_access_key,
152-
config=self.config
152+
config=self.config,
153+
endpoint_url=self._endpoint_url
153154
)
154155
bucket = s3.Bucket(self._bucket_name)
155156

@@ -176,6 +177,11 @@ def _bucket_name(self):
176177
url_path = urlparse(self.url).path.lstrip('/')
177178
return url_path.split('/')[0]
178179

180+
@property
181+
def _endpoint_url(self):
182+
url_path = urlparse(self.url)
183+
return url_path._replace(params="", fragment="", query="", path="").geturl()
184+
179185
@property
180186
def _remote_path(self):
181187
url_path = urlparse(self.url).path.lstrip('/')

0 commit comments

Comments
 (0)