Merge "[placement] Use modern attributes of oslo_context"

This commit is contained in:
Jenkins 2017-03-06 23:46:40 +00:00 committed by Gerrit Code Review
commit 5f60f31c55
2 changed files with 3 additions and 3 deletions

View File

@ -71,7 +71,7 @@ class PlacementKeystoneContext(Middleware):
ctx = RequestContext.from_environ(
req.environ, request_id=req_id)
if ctx.user is None:
if ctx.user_id is None:
LOG.debug("Neither X_USER_ID nor X_USER found in request")
return webob.exc.HTTPUnauthorized()

View File

@ -60,8 +60,8 @@ def placement_authorize(context, action, target=None):
"""
placement_init()
if target is None:
target = {'project_id': context.tenant,
'user_id': context.user}
target = {'project_id': context.project_id,
'user_id': context.user_id}
credentials = context.to_policy_values()
# TODO(alaski): Change this to use authorize() when rules are registered.
# noqa the following line because a hacking check disallows using enforce.