common Package

context Module

Simple class that stores security context information in the web request.

Projects should subclass this class if they wish to enhance the request context or provide additional information in their specific WSGI pipeline.

class keystone.openstack.common.context.RequestContext(auth_token=None, user=None, tenant=None, domain=None, user_domain=None, project_domain=None, is_admin=False, read_only=False, show_deleted=False, request_id=None, instance_uuid=None)[source]

Bases: 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.

to_dict()[source]
user_idt_format = '{user} {tenant} {domain} {user_domain} {p_domain}'
keystone.openstack.common.context.generate_request_id()[source]
keystone.openstack.common.context.get_admin_context(show_deleted=False)[source]
keystone.openstack.common.context.get_context_from_function_and_args(function, args, kwargs)[source]

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.

eventlet_backdoor Module

exception Module

excutils Module

fileutils Module

gettextutils Module

importutils Module

Import related utilities and helper functions.

keystone.openstack.common.importutils.import_class(import_str)[source]

Returns a class from a string including module and class.

keystone.openstack.common.importutils.import_module(import_str)[source]

Import a module.

keystone.openstack.common.importutils.import_object(import_str, *args, **kwargs)[source]

Import a class and return an instance of it.

keystone.openstack.common.importutils.import_object_ns(name_space, import_str, *args, **kwargs)[source]

Tries to import object from default namespace.

Imports a class and return an instance of it, first by trying to find the class in a default namespace, then failing back to a full path if not found in the default namespace.

keystone.openstack.common.importutils.try_import(import_str, default=None)[source]

Try to import a module and if it fails return default.

jsonutils Module

local Module

Local storage of variables using weak references

class keystone.openstack.common.local.WeakLocal[source]

Bases: thread._local

lockutils Module

log Module

log_handler Module

loopingcall Module

network_utils Module

policy Module

processutils Module

service Module

sslutils Module

strutils Module

test Module

threadgroup Module

timeutils Module

uuidutils Module

UUID related utilities and helper functions.

keystone.openstack.common.uuidutils.generate_uuid()[source]
keystone.openstack.common.uuidutils.is_uuid_like(val)[source]

Returns validation of a value as a UUID.

For our purposes, a UUID is a canonical form string: aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa

versionutils Module