Loading src/common/tools/rest_api/client/RestApiClient.py +8 −2 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,10 @@ class RestApiClient: endpoint = str(self._base_url + '/' + endpoint).replace('//', '/').lstrip('/') endpoint = str(self._base_url + '/' + endpoint).replace('//', '/').lstrip('/') request_url = TEMPLATE_URL.format(self._scheme, self._address, self._port, endpoint) request_url = TEMPLATE_URL.format(self._scheme, self._address, self._port, endpoint) self._log_msg_request(method, request_url, body) self._log_msg_request( method, request_url, body, log_level=logging.DEBUG ) try: try: headers = {'accept': 'application/json'} headers = {'accept': 'application/json'} Loading @@ -127,7 +130,10 @@ class RestApiClient: if self._logger is not None: self._logger.exception(msg) if self._logger is not None: self._logger.exception(msg) raise Exception(msg) from e raise Exception(msg) from e self._log_msg_check_reply(method, request_url, body, reply, expected_status_codes) self._log_msg_check_reply( method, request_url, body, reply, expected_status_codes, log_level=logging.DEBUG ) if reply.content and len(reply.content) > 0: return reply.json() if reply.content and len(reply.content) > 0: return reply.json() return None return None Loading Loading
src/common/tools/rest_api/client/RestApiClient.py +8 −2 Original line number Original line Diff line number Diff line Loading @@ -112,7 +112,10 @@ class RestApiClient: endpoint = str(self._base_url + '/' + endpoint).replace('//', '/').lstrip('/') endpoint = str(self._base_url + '/' + endpoint).replace('//', '/').lstrip('/') request_url = TEMPLATE_URL.format(self._scheme, self._address, self._port, endpoint) request_url = TEMPLATE_URL.format(self._scheme, self._address, self._port, endpoint) self._log_msg_request(method, request_url, body) self._log_msg_request( method, request_url, body, log_level=logging.DEBUG ) try: try: headers = {'accept': 'application/json'} headers = {'accept': 'application/json'} Loading @@ -127,7 +130,10 @@ class RestApiClient: if self._logger is not None: self._logger.exception(msg) if self._logger is not None: self._logger.exception(msg) raise Exception(msg) from e raise Exception(msg) from e self._log_msg_check_reply(method, request_url, body, reply, expected_status_codes) self._log_msg_check_reply( method, request_url, body, reply, expected_status_codes, log_level=logging.DEBUG ) if reply.content and len(reply.content) > 0: return reply.json() if reply.content and len(reply.content) > 0: return reply.json() return None return None Loading