mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 17:37:30 -02:30
Don't error on a trailing slash, just fix it up
This commit is contained in:
@@ -74,9 +74,11 @@ class Connection(object):
|
|||||||
raise ConnectionException(message="Unknown request method: {0}".format(method))
|
raise ConnectionException(message="Unknown request method: {0}".format(method))
|
||||||
|
|
||||||
use_endpoint = relative_endpoint
|
use_endpoint = relative_endpoint
|
||||||
if self.server.endswith('/') and use_endpoint.startswith('/'):
|
if self.server.endswith('/'):
|
||||||
raise RuntimeError('AWX URL given with trailing slash, remove slash.')
|
self.server = self.server[:-1]
|
||||||
url = '{0.server}{1}'.format(self, use_endpoint)
|
if use_endpoint.startswith('/'):
|
||||||
|
use_endpoint = use_endpoint[1:]
|
||||||
|
url = '/'.join([self.server, use_endpoint])
|
||||||
|
|
||||||
kwargs = dict(verify=self.verify, params=query_parameters, json=json, data=data,
|
kwargs = dict(verify=self.verify, params=query_parameters, json=json, data=data,
|
||||||
hooks=dict(response=log_elapsed))
|
hooks=dict(response=log_elapsed))
|
||||||
|
|||||||
Reference in New Issue
Block a user