Skip to content

Commit

Permalink
Add username on the log for logout and rescope.
Browse files Browse the repository at this point in the history
  • Loading branch information
lin-hua-cheng committed Apr 26, 2013
1 parent fcee315 commit 7a1d24f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions openstack_auth/views.py
Expand Up @@ -71,7 +71,9 @@ def login(request):


def logout(request):
LOG.info('User logging out.')
msg = 'Logging out user "%(username)s".' % \
{'username': request.user.username}
LOG.info(msg)
if 'token_list' in request.session:
t = Thread(target=delete_all_tokens,
args=(list(request.session['token_list']),))
Expand Down Expand Up @@ -106,9 +108,13 @@ def switch(request, tenant_id, redirect_field_name=REDIRECT_FIELD_NAME):
try:
token = client.tokens.authenticate(tenant_id=tenant_id,
token=request.user.token.id)
LOG.info('Token rescoping successful.')
msg = 'Tenant switch successful for user "%(username)s".' % \
{'username': request.user.username}
LOG.info(msg)
except keystone_exceptions.ClientException:
LOG.warning('Token rescoping failed.')
msg = 'Tenant switch failed for user "%(username)s".' % \
{'username': request.user.username}
LOG.warning(msg)
token = None
LOG.exception('An error occurred while switching sessions.')

Expand Down

0 comments on commit 7a1d24f

Please sign in to comment.