Use oslo.context class method to construct context object
oslo_context.Context.from_environ provides a more generic way
to contruct a context object from request environment.
We can support more new attributes supported in keystonemiddleware
without changing our code.
Partial-Bug: #1674349
Closes-Bug: #1621073
In the unit test, context.tenant_name is replaced to context.project_name
as it will be the recommended way to access project name now.
Note that equivalency of project_name and tenant_name will be ensured
by a depending neutron-lib patch [1], so this change affects nobody.
Reviewed: https:/ /review. openstack. org/448538 /git.openstack. org/cgit/ openstack/ neutron/ commit/ ?id=75c34838ef7 132352a34b0c224 c2536a5283b1d5
Committed: https:/
Submitter: Jenkins
Branch: master
commit 75c34838ef71323 52a34b0c224c253 6a5283b1d5
Author: Akihiro Motoki <email address hidden>
Date: Wed Mar 22 11:55:31 2017 +0000
Use oslo.context class method to construct context object
oslo_ context. Context. from_environ provides a more generic way
to contruct a context object from request environment.
We can support more new attributes supported in keystonemiddleware
without changing our code.
Partial-Bug: #1674349
Closes-Bug: #1621073
In the unit test, context.tenant_name is replaced to context. project_ name
as it will be the recommended way to access project name now.
Note that equivalency of project_name and tenant_name will be ensured
by a depending neutron-lib patch [1], so this change affects nobody.
[1] https:/ /review. openstack. org/#/c/ 448537/
Depends-On: Ieec57d9ea8d95e 55499a17e2c04da 5e3e78a1557 2b1e93e760d2e3e 8aaa38aed56
Change-Id: Ie48aa843ca8c85