Skip to content

Commit a3148c1

Browse files
committed
Change how AWS calling url is generated
1 parent 569e12d commit a3148c1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/shipchain_common/aws.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ class AWSClient:
4040

4141
def _call(self, http_method, endpoint, payload=None, params=None):
4242
metric_name = self._get_generic_endpoint_for_metric(http_method, endpoint)
43-
self.url = f'{self.url}/{endpoint}'
43+
calling_url = f'{self.url}/{endpoint}'
44+
4445
if payload:
4546
payload = json.dumps(payload, cls=DecimalEncoder)
4647

@@ -49,14 +50,14 @@ def _call(self, http_method, endpoint, payload=None, params=None):
4950
with TimingMetric('python_common_aws.call', tags={'method': metric_name}) as timer:
5051

5152
if http_method == self.METHOD_POST:
52-
response = self.session.post(self.url, data=payload, params=params)
53+
response = self.session.post(calling_url, data=payload, params=params)
5354
response_json = response.json()
5455

5556
if response.status_code != status.HTTP_201_CREATED:
5657
self._process_error_object(metric_name, response, response_json)
5758

5859
elif http_method in self.RESPONSE_200_METHODS:
59-
response = getattr(self.session, http_method)(self.url, data=payload, params=params)
60+
response = getattr(self.session, http_method)(calling_url, data=payload, params=params)
6061
response_json = response.json()
6162

6263
if response.status_code != status.HTTP_200_OK:

0 commit comments

Comments
 (0)