glance.image_cache.drivers.common module

Common code which will be used in SQLite and centralzed_db driver until SQLite driver is removed from glance.

class glance.image_cache.drivers.common.SqliteConnection(*args, **kwargs)[source]

Bases: Connection

SQLite connection that retries on database-is-locked errors with a bounded total wait, similar to Swift’s SQLite helper.

commit()[source]

Commit any pending transaction to the database.

If there is no open transaction, this method is a no-op.

execute(*args, **kwargs)[source]

Executes an SQL statement.

glance.image_cache.drivers.common.dict_factory(cur, row)[source]
glance.image_cache.drivers.common.get_db(db_path)[source]

Returns a context manager that produces a database connection that self-closes and calls rollback if an error occurs while using the database connection