Skip to content

Commit

Permalink
Better log
Browse files Browse the repository at this point in the history
  • Loading branch information
NotChristianGarcia committed Nov 21, 2024
1 parent 0bf2e1d commit f392105
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions service/api_pods_podid_func.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ async def pod_auth(pod_id_net, request: Request):

logger.debug(f"GET /pods/{pod_id_net}/auth - pod-auth, headers: {request.headers}, request.cookies: {request.cookies}, tenant_id: {g.request_tenant_id}, derived_tenant_id: {tapis_tenant}, site_id: {g.site_id}")

td = None
# Create tapis client or update tapis client if needed
try:
res, td = t.authenticator.create_client(
Expand All @@ -381,7 +382,7 @@ async def pod_auth(pod_id_net, request: Request):
display_name = client_display_name,
description = client_description,
_x_tapis_tenant = tapis_tenant,
_x_tapis_user = "_tapis_pods",
_x_tapis_user = "tapis_pods",
_tapis_debug = True
)
except BadRequestError as e: # Exceptions in 3 shouldn't have e.message (only e.args), but this one does.
Expand All @@ -395,7 +396,7 @@ async def pod_auth(pod_id_net, request: Request):
display_name = client_display_name,
description = client_description,
_x_tapis_tenant = tapis_tenant,
_x_tapis_user = "_tapis_pods",
_x_tapis_user = "tapis_pods",
_tapis_debug = True
)
# Assuming you want to return a success response after updating
Expand All @@ -407,7 +408,7 @@ async def pod_auth(pod_id_net, request: Request):
msg = (f"Error updating client_id: {client_id}. e: {e.args}, e: {e}, dir(e): {dir(e)}")
logger.warning(msg)
return JSONResponse(content = msg, status_code = 500)
msg = (f"Error creating client_id: {client_id}. e: {e.args}, e: {e.message}, dir(e): {dir(e)}")
msg = (f"Error creating client_id: {client_id}. e.message: {e.message}, e.request: {e.request}, e.response: {e.response}, tapis_debug = {td}")
logger.warning(msg)
return JSONResponse(content = msg, status_code = 500)

Expand Down

0 comments on commit f392105

Please sign in to comment.