def get_token_ref(context):
 try:
  auth_context = context['environment'][authorization.AUTH_CONTEXT_ENV]
  return auth_context['token']
 except KeyError:
  msg = _("Couldn't find the auth context.")
  LOG.warning(msg)
  raise exception.Unauthorized(msg)

def get_token_ref ( context ) : try : auth_context = context [ 'environment' ] [ authorization . AUTH_CONTEXT_ENV ] return auth_context [ 'token' ] except KeyError : msg = _ ( "Couldn't find the auth context." ) LOG . warning ( msg ) raise exception . Unauthorized ( msg )
retrieve keystonetoken object from the auth context and returns it .