Browse Source

Add error message and NSX time for failed authentication

In addition to status code, also log error message and
local NSX time for failed NSX authentication for
easier troubleshooting for failed JWT authentication and
potential clock drift between NSX, VC and Master node.

Change-Id: Icf31477bffda85ba73a1123232b6aa5503066922
changes/84/751884/2
Xiaotong Luo 2 years ago
parent
commit
5fd0ce5752
  1. 7
      vmware_nsxlib/v3/cluster.py

7
vmware_nsxlib/v3/cluster.py

@ -284,8 +284,11 @@ class NSXRequestsHTTPProvider(AbstractHTTPProvider):
else:
if resp.status_code != 200 and resp.status_code != 201:
LOG.warning("Session create failed for endpoint %s with "
"response %s",
provider.url, resp.status_code)
"response %s, error message: %s, "
"local NSX time: %s",
provider.url, resp.status_code,
resp.json().get('error_message'),
resp.headers['Date'])
# this may will later cause the endpoint to be Down
else:
for header_name in resp.headers:

Loading…
Cancel
Save