From 793dad2edce2a559fae27d5e5cfd771e7d36f314 Mon Sep 17 00:00:00 2001 From: Nanda Kishore Peddi Date: Fri, 5 Jan 2024 10:48:27 +0530 Subject: [PATCH] Format Debug Log --- icontrol/__init__.py | 2 +- icontrol/authtoken.py | 8 ++++---- icontrol/session.py | 10 +++++----- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/icontrol/__init__.py b/icontrol/__init__.py index ed6cd8a..19937bc 100644 --- a/icontrol/__init__.py +++ b/icontrol/__init__.py @@ -1 +1 @@ -__version__ = "1.3.15" +__version__ = "1.3.16" diff --git a/icontrol/authtoken.py b/icontrol/authtoken.py index b2aa0fc..d8863f5 100644 --- a/icontrol/authtoken.py +++ b/icontrol/authtoken.py @@ -100,7 +100,7 @@ def get_auth_providers(self, netloc): response = requests.get(url, verify=self.verify, proxies=self.proxies) if not response.ok or not hasattr(response, "json"): - error_message = '%s Unexpected Error: %s for uri: %s\nText: %r' %\ + error_message = '%s Unexpected Error: %s for uri: %s Text: %r' %\ (response.status_code, response.reason, response.url, @@ -155,7 +155,7 @@ def get_new_token(self, netloc): ) self.attempts += 1 if not response.ok or not hasattr(response, "json"): - error_message = '%s Unexpected Error: %s for uri: %s\nText: %r' %\ + error_message = '%s Unexpected Error: %s for uri: %s Text: %r' %\ (response.status_code, response.reason, response.url, @@ -173,7 +173,7 @@ def get_new_token(self, netloc): ) except (KeyError, ValueError): error_message = \ - '%s Unparseable Response: %s for uri: %s\nText: %r' %\ + '%s Unparseable Response: %s for uri: %s Text: %r' %\ (response.status_code, response.reason, response.url, @@ -187,7 +187,7 @@ def get_new_token(self, netloc): ) except iControlUnexpectedHTTPError: error_message = \ - '%s Token already expired: %s for uri: %s\nText: %r' % \ + '%s Token already expired: %s for uri: %s Text: %r' % \ (response.status_code, time.ctime(expiration_bigip), response.url, diff --git a/icontrol/session.py b/icontrol/session.py index 906af84..7263edf 100644 --- a/icontrol/session.py +++ b/icontrol/session.py @@ -281,13 +281,13 @@ def wrapper(self, RIC_base_uri, **kwargs): response = method(self, REST_uri, **kwargs) post_message =\ "RESPONSE::STATUS: %s Content-Type: %s Content-Encoding:"\ - " %s\nText: %r" % (response.status_code, - response.headers.get('Content-Type', None), - response.headers.get('Content-Encoding', None), - response.text) + " %s Text: %r" % (response.status_code, + response.headers.get('Content-Type', None), + response.headers.get('Content-Encoding', None), + response.text) logger.debug(post_message) if response.status_code not in range(200, 207): - error_message = '%s Unexpected Error: %s for uri: %s\nText: %r' %\ + error_message = '%s Unexpected Error: %s for uri: %s Text: %r' %\ (response.status_code, response.reason, response.url,