This is follow up of commit 0a1bae9859079fb21a03716be947c5f1da6db0a2.
Log warning when pass keyword argument sqlite_db.
Related-Bug: #1329086
Change-Id: Ibed55dc9f28b7813bd96fb5e6f5138de0667591f
Adds new methods make_new_manager(), patch_factory(),
patch_engine(), to provide support to test fixtures that
wish to generate new managers from an existing one, and to
cross-patch managers, factories and engines into other managers.
Change-Id: I83c6296d992f08117fff1438bc079bbf71db787b
Propagates logging_name through enginefacade.configure()
to create_engine(), as will be used in the enginefacade-based
test suite.
Change-Id: Iabc03adbef9792e0be4d86c98851890846638efc
Pymysql can raise 'lock wait timeout exceeded' errors
as InternalErrors. The previous filter was only catching
OperationalError exceptions. This patch changes it to
catch all DatabaseErrors, which both of the aforementioned
exceptions inherit.
Change-Id: If7bd1ceef6e5d64f0766b780616388c62862ce82
Closes-Bug: #1608691
Add on_engine_create argument to transaction_context to enable users
to take some actions with newly created engines. Main intended usage
is providing oslo.db and osprofiler users with a way to hook them
together without making them depend on each other.
Closes-bug: #1600739
Change-Id: I78bef4979c2000d05658ce17d0348cd0a10c24d9
This presents a system of reporting the ultimate "cause" in the
case that a MySQL failed SAVEPOINT rollback occurs.
Change-Id: Iea834429a0b8398f076b10426525a5c17dbf3c85
Removes the separate per-Python-interpreter
setup for the pifpaf run and consolidates necessary
variables in one place to be passed into a single command
line.
Change-Id: I2f34642f16d6dba5b01500fcdc89e88b93642cd3
Replaced all slashes in the paths with os.path.join,
so that they are compatible with Windows and Linux.
Change-Id: I65665a0f109d60b7a3e4187dd3c9409151d04ec7
Openstack applications such as Neutron will refer to
the engine.pool.dispose() method in order to remove
any remaining connections, typically as part of
a test suite. Add a public-facing method to the context
and its underlying factory so this can be called without
underscore access.
Change-Id: I18b16e002a8507eb2eaa3a7f168e853b0ca17aa5
There is a set allowable minimum and maximum to the connection_debug
option of 0 and 100. The config option should enforce this.
Change-Id: Ica610ad8fc0875a8be1042f7daba5d0a0c1aad03
The max_pool_size defaults to 5 instead of None. Setting this
option to 0 effective disables an upper limit to the pool.
Change-Id: I9a6918e1a808e9e70105d5b21d901bbe3d298f34
py35 jobs are going to be run in the gate soon. Add py35 to the list
of defaut envs and add corresponding pifpaf environments for running
tests locally.
All py35 tests currently pass - we can effectively declare py35
compatibility via a new classifier in setup.cfg.
Change-Id: Iea7e286062f95d5c61b9ec1e7f6af4138fe3ce99
We should use config option connection or slave_connection to connect
to the database. We can remove it when all consuming projects don't use
it anymore.
Related-Bug: #1329086
Change-Id: I1960e47b27b5f98f19a07f9899079269bac025cc
We can have integrity constraint violations when the
value is an empty string. The previous regex for converting
these into DBDuplicate exceptions was not considering this
case.
This adjusts the regex to a 0 or many instead of a 1 or many
match for the value and adds a case to a test.
Change-Id: Ibf4686f92fcffb8e70ec2735ab878e8849ed37b1
Closes-Bug: #1599086
Just in case mention the changes done in CR #318135, so that people
are aware of those (although, we've double checked everyone passes
the argument value explicitly now and that's the only reason the
decorator actually performs any retries in downstreams).
Change-Id: I263b2078535a3f06461e8905003b484a38d05f08
The current defaults do not make much sense: having max_retries set to 0
completely avoid any retry, which is the whole point of that wrapper.
This patch moves the correct default values from the DBAPI object to the
wrap_db_retry() function itself.
Change-Id: I89c2bd09e69b8b77b716573eb8b889c01f9d0f54