ironic.common.context module

class ironic.common.context.RequestContext(is_public_api=False, **kwargs)[source]

Bases: oslo_context.context.RequestContext

Extends security contexts from the oslo.context library.

ensure_thread_contain_context()[source]

Ensure threading contains context

For async/periodic tasks, the context of local thread is missing. Set it with request context and this is useful to log the request_id in log messages.

classmethod from_dict(values, **kwargs)[source]

Construct a context object from a provided dictionary.

to_policy_values()[source]

A dictionary of context attributes to enforce policy with.

oslo.policy enforcement requires a dictionary of attributes representing the current logged in user on which it applies policy enforcement. This dictionary defines a standard list of attributes that should be available for enforcement across services.

It is expected that services will often have to override this method with either deprecated values or additional attributes used by that service specific policy.

ironic.common.context.get_admin_context()[source]

Create an administrator context.