keystone.openstack.common.db package

Submodules

keystone.openstack.common.db.api module

Multiple DB API backend support.

A DB backend module should implement a method named ‘get_backend’ which takes no arguments. The method can return any object that implements DB API methods.

class keystone.openstack.common.db.api.DBAPI(backend_name, backend_mapping=None, lazy=False, **kwargs)[source]

Bases: object

keystone.openstack.common.db.api.safe_for_db_retry(f)[source]

Enable db-retry for decorated function, if config option enabled.

class keystone.openstack.common.db.api.wrap_db_retry(retry_interval, max_retries, inc_retry_interval, max_retry_interval)[source]

Bases: object

Retry db.api methods, if DBConnectionError() raised

Retry decorated db.api methods. If we enabled use_db_reconnect in config, this decorator will be applied to all db.api functions, marked with @safe_for_db_retry decorator. Decorator catchs DBConnectionError() and retries function in a loop until it succeeds, or until maximum retries count will be reached.

keystone.openstack.common.db.exception module

DB related custom exceptions.

exception keystone.openstack.common.db.exception.DBConnectionError(inner_exception=None)[source]

Bases: keystone.openstack.common.db.exception.DBError

Wraps connection specific exception.

exception keystone.openstack.common.db.exception.DBDeadlock(inner_exception=None)[source]

Bases: keystone.openstack.common.db.exception.DBError

exception keystone.openstack.common.db.exception.DBDuplicateEntry(columns=, []inner_exception=None)[source]

Bases: keystone.openstack.common.db.exception.DBError

Wraps an implementation specific exception.

exception keystone.openstack.common.db.exception.DBError(inner_exception=None)[source]

Bases: exceptions.Exception

Wraps an implementation specific exception.

exception keystone.openstack.common.db.exception.DBInvalidUnicodeParameter[source]

Bases: exceptions.Exception

message = u'Invalid Parameter: Unicode is not supported by the current database.'
exception keystone.openstack.common.db.exception.DbMigrationError(message=None)[source]

Bases: keystone.openstack.common.db.exception.DBError

Wraps migration specific exception.

keystone.openstack.common.db.options module

keystone.openstack.common.db.options.list_opts()[source]

Returns a list of oslo.config options available in the library.

The returned list includes all oslo.config options which may be registered at runtime by the library.

Each element of the list is a tuple. The first element is the name of the group under which the list of elements in the second element will be registered. A group name of None corresponds to the [DEFAULT] group in config files.

The purpose of this is to allow tools like the Oslo sample config file generator to discover the options exposed to users by this library.

Returns:a list of (group_name, opts) tuples
keystone.openstack.common.db.options.set_defaults(sql_connection, sqlite_db, max_pool_size=None, max_overflow=None, pool_timeout=None)[source]

Set defaults for configuration variables.

Module contents