Skip to content

Commit

Permalink
Fix debug logging
Browse files Browse the repository at this point in the history
If exception occurred (timeout to HyperCore cluster), resp was not defined
and code crashed.
Also, q() cannot be called with kwargs syntax (`exception=ex`).

Signed-off-by: Justin Cinkelj <[email protected]>
  • Loading branch information
justinc1 committed Sep 26, 2023
1 parent 3782a8a commit 8cb22cc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions plugins/module_utils/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,9 @@ def _request(
)
q_log(request_in, request_out)
return resp
except Exception as ex:
except Exception as exception:
if SC_DEBUG_LOG_TRAFFIC:
request_out = dict(
status=resp.status,
data=resp.data,
headers=resp.headers,
)
q_log(request_in, exception=ex)
q_log(request_in, exception)
raise

def _request_no_log(
Expand Down

0 comments on commit 8cb22cc

Please sign in to comment.