Skip to content

Commit

Permalink
Fix 'int is not iterable' during TMC validation (#37)
Browse files Browse the repository at this point in the history
Users get the message above when TMC token validation fails. This pull
request fixes that.

Signed-off-by: Carlos Nunez <ncarlos@vmware.com>
  • Loading branch information
carlosonunez-vmw committed May 30, 2022
1 parent 6eea03b commit abc93b0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/common/prechecks/precheck.py
Expand Up @@ -1013,8 +1013,14 @@ def validateToken(token, serviceList):
"msg": serviceList[0] + " login failed using Refresh_Token ",
"ERROR_CODE": 500
}
current_app.logger.error(serviceList[0] + " login failed using Refresh_Token - %s" % token)
return 500
body = json.dumps(response_login)
if 'message' in body:
error = body['message']
else:
error = 'unknown error'
current_app.logger.error(serviceList[0] + " login failed using Refresh_Token - %s: %s" %
token, error)
return error, 500
access_token = response_login.json()["access_token"]

url = "https://console.cloud.vmware.com/csp/gateway/am/api/auth/api-tokens/details"
Expand Down

0 comments on commit abc93b0

Please sign in to comment.