Don't pass kwargs to the client if there isn't any
This resolves an issue where doing a request (i.e, GET) without kwargs would fail. Change-Id: Iac5be67bd1a558701c0ac0dbca50e5284730bebe
This commit is contained in:
parent
c907258a61
commit
c9a08e7680
|
@ -46,11 +46,18 @@ class AraOfflineClient(object):
|
|||
|
||||
def _request(self, method, endpoint, **kwargs):
|
||||
func = getattr(self.client, method)
|
||||
response = func(
|
||||
endpoint,
|
||||
json.dumps(kwargs),
|
||||
content_type='application/json'
|
||||
)
|
||||
# TODO: Is there a better way than doing this if/else ?
|
||||
if kwargs:
|
||||
response = func(
|
||||
endpoint,
|
||||
json.dumps(kwargs),
|
||||
content_type='application/json'
|
||||
)
|
||||
else:
|
||||
response = func(
|
||||
endpoint,
|
||||
content_type='application/json'
|
||||
)
|
||||
|
||||
self.log.debug('HTTP {status}: {method} on {endpoint}'.format(
|
||||
status=response.status_code,
|
||||
|
|
Loading…
Reference in New Issue