[openstack-dev] [oslo] oslo.context and name fields

Sean Dague sean at dague.net
Tue Apr 5 18:31:46 UTC 2016


I was trying to clean up the divergent logging definitions in devstack
as part of scrubbing out 'tenant' references -
https://review.openstack.org/#/c/301801/ and in doing so stumbled over
the fact that the extremely useful project_name and user_name fields are
not in base oslo.context.

https://github.com/openstack/oslo.context/blob/c63a359094907bc50cc5e1be716508ddee825dfa/oslo_context/context.py#L148-L159

These are always available to be set -
http://docs.openstack.org/developer/keystonemiddleware/api/keystonemiddleware.auth_token.html#what-auth-token-adds-to-the-request-for-use-by-the-openstack-service

And they are extremely valuable when a human is looking at logs, as you
actually can remember names when looking at various services to cross
reference things. Nova has a custom context that sets these things -
https://github.com/openstack/nova/blob/d57a4e8be9147bd79be12d3f5adccc9289a375b6/nova/api/auth.py#L114-L115

I would really like these to be available in all services using
oslo.context.

So the question is, were these not implemented on purpose? Is the
opposition to putting them into oslo.context?

Please let me know before I start going down this path.

	-Sean

-- 
Sean Dague
http://dague.net



More information about the OpenStack-dev mailing list