主要维护者¶
- 主要维护者
未知
- 其他贡献者
无
https://blueprints.launchpad.net/oslo-incubator/+spec/graduate-oslo-context
oslo.context 包含上下文基类,它定义了 oslo.messaging 和 oslo.log 使用的 API。
新库的名称是什么?: oslo.context
openstack/common/context.py
tests/unit/test_context.py
oslo.log
oslo.messaging
import oslo_context
所有现有的公共函数和类将保持公共。
def generate_request_id():
"Return a unique request identifier."
class RequestContext(object):
"""Helper class to represent useful information about a request context.
Stores information about the security context under which the user
accesses the system, as well as additional request information.
"""
def get_admin_context(show_deleted=False):
"Return a RequestContext configured as an admin user"
def get_context_from_function_and_args(function, args, kwargs):
"""Find an arg of type RequestContext and return it.
This is useful in a couple of decorators where we don't
know much about the function we're wrapping.
"""
def is_user_context(context):
"""Indicates if the request context is a normal user."""
将使用 threading.local() 实例和基于 nova.context.RequestContext 的逻辑来维护上下文对象的私有注册表。将添加一个新的公共 API 来访问上下文
def get_current():
"Return this thread's current context"
doug-hellmann
无
未知
无
doug-hellmann
完成目标里程碑: kilo-1
https://wiki.openstack.org/wiki/Oslo/CreatingANewLibrary#Checklist
添加注册表管理逻辑。
我们将根据 oslo.messaging 和 oslo.log 的需求,在导出 RequestContext 之后演进 API。这些更改尚未确定,将在另一个规范中提出。
使用 oslo.context 的项目应继承 oslo_context.RequestContext 并创建自己特定的应用程序上下文类。
无
https://etherpad.openstack.org/p/kilo-oslo-library-proposals
https://blueprints.launchpad.net/oslo.log/+spec/remove-context-adapter
https://blueprints.launchpad.net/oslo.log/+spec/app-agnostic-logging-parameters
注意
本作品采用知识共享署名 3.0 非移植许可协议授权。 http://creativecommons.org/licenses/by/3.0/legalcode
除非另有说明,此文档根据 知识共享署名 3.0 许可 授权。请参阅所有 OpenStack 法律文件。