| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Related-Bug: 1572417
Depends-on: I984c53e30f4794738c38154273f12efbbcb549b3
Change-Id: I9d8ce19bac0a62404b53cb099a17f7b71a3c3ad2
|
|
|
|
| |
Change-Id: I9d58f5d25857c88798b7a8b2180dde44db56b5fc
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
testscenarios has an uncapped dependency on testtools.
testtools 2.0.0 requires fixtures>=1.3.0.
fixtures 1.2.1 requires testtools<2.0.0.
kilo g-r caps fixtures<1.3.0 and testtools<2.0.0.
We have to add testtools to oslo.db's requirements.txt
to use the cap from kilo g-r before testscenarios installs
uncapped testtools, which will break since we cap fixtures,
which caps testtools.
Yay!
Also, add defaultbranch to .gitreview.
Change-Id: Ib95b8070cee6e6ff47d9c302c89577a75a28d83d
Closes-Bug: #1555721
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 0.6.2, the exc.statement and exc.params were as follows:
exc.statement = {unicode} u'INSERT INTO resource_entity (id, foo_id)
VALUES (%s, %s)'
exc.params = {tuple} (1, 2)
In 0.7.1, the exc.statement and exc.params are as follows:
exc.statement = {unicode} u'INSERT INTO resource_entity (id, foo_id)
VALUES (%(id)s, %(foo_id)s)'
exc.params = {dict} {'id': 1, 'foo_id': 2}
So the easiest thing to support both is to use string interpolation
and then check if they are equal. This approach works for both py34
and py27 as well. Note that we still have to test the old way for
sqlite which has (?, ?) in the SQL statement.
NOTE(tonyb): We need to make the same change in
.../old_import_api/.../test_exc_filters.py in the stable/kilo branch.
This was removed in the liberty timeframe in
If3036e03a68c2e865b5f0495c74fe8303de93d21
Closes-Bug: #1533861
Change-Id: Iab9f0e4b4dd337363dd7e705c1155f3f6517b404
(cherry picked from commit 543d577613a5ccc12f4482d9e2f9ce1f29db21b4)
(cherry picked from commit 40004ebbca6c345da09cec4e91f85fc73ab18e70)
|
|
|
|
| |
Change-Id: I64ecf19fa0097ff1939e99b26cd8eb414b550a22
|
|
|
|
| |
Change-Id: I6240c01f0e344965e1e0664c7de9d4d015f91c4f
|
|
|
|
| |
Change-Id: Idab1d9edc5ba8dcca65f688957acd7c6e294e6b0
|
|
|
|
| |
Change-Id: Ib854799c9042cd6442a0e17f67671f8532f26370
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Mention mock explicitly rather than relying on it to be installed
as a transitive dependency, so that we have control on the mock
versions allowed.
Closes-Bug: #1476665
(cherry-picked from a21111d97151ca8d84c3bf4dd779374bfb0c83ed)
Change-Id: Id734c3d7b7ef1ab8d97a13edb1de006c029c22a0
|
|/
|
|
| |
Change-Id: Icaf116a2eafad4ce34a26879d4f19b66cac62506
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Such exception indicates of error condition only if
retries are exceeded. In other cases error-level logs
pollute the log file and complicate log analysis.
Change-Id: I318867043a68a6499851631593859a0fffac6038
Closes-Bug: #1433001
(cherry picked from commit 02aeda28cf8b69f39f934a3e80cb7cae04c5fc20)
|
|/
|
|
| |
Change-Id: I82eda050e801cf84b7438c79f59079a096429c17
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's not safe for a database TCP connection to be
shared to a child process, as this is a file descriptor
which will maintain its state on both sides. Applications
such as Cinder which spin up multiprocessing subprocesses
at startup time are subject to race conditions as a result.
Instead of requiring that engines be explicitly prepared
within a child process, we can detect and accommodate
this situation in the connection pool itself, by tracking
the originating pid of a connection, and if it changes
on checkout, by invalidating.
Change-Id: If116f7b7140b3eba064d8147e5f637a05beb1cd8
(cherry picked from commit ebbf23d6490159f0c8f4f35a08fb4b80371cd080)
|
|
|
|
|
|
|
| |
Looks like we missed one!
Closes-Bug: #1431268
Change-Id: I125c7fb66967b83e786c2f697d7bda68d361cb30
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
I had to go digging into how this worked to figure out the missing
"_ADMIN_".
Change-Id: Id9a48cf413eacd04473f3413421681b32cbf5f29
|
|/
|
|
| |
Change-Id: I577fec9512ca2a94418f37ea955cf590aea1c6d5
|
|
|
|
| |
Change-Id: I9f799c931804d0695fd64b238ad0a6c5dbbb6cf1
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
MySQLDb driver works only with python2.x, so we should use an another
connector for work with python3.
Used OS_TEST_DBAPI_ADMIN_CONNECTION env variable to set connection
strings.
Change-Id: I27fbe8f87c713b53a0b1831543a23f7c06fe454b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently, DBAPI __getattr__() implementation will *always*
implicitly wrap all mocked methods of a target class/module using
wrap_db_retry(), as retry_on_* attributes will always exist and be
true for mock instances. Not only this leads to a situation, when
we would retry methods, we were not going to retry, but this also
fails with AttributeError on functools.wraps() call, breaking valid
unit tests in projects.
DBAPI is changed in a way, so that it does dict look ups instead of
fetching instance attributes to ensure mocked methods are handled
correctly and aren't wrapped when they shouldn't be wrapped.
Related issue:
http://stackoverflow.com/questions/22204660/python-mock-wrapsf-problems
Change-Id: I36550ffa88056c53a431d64e61e84fbb44bbf68d
|
| |
| |
| |
| | |
Change-Id: Ie0a3c19e005fab985b1d6abaf1ac785471fffd8e
|
| |
| |
| |
| |
| |
| |
| | |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: If2388281d6e9cf3c76cee2293636aab8873818f6
|
|/
|
|
|
|
|
|
| |
When PyMySQL experiences a constraing error a unicode string prefix is
prepended part way through the inner_exception string. As a result, we
raise a DBError when we should be raising a DBReferenceError.
Change-Id: I5de1333d933bd28ca535852f4643df2ebbc7f964
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change introduces the use of the testresources package,
such that the provisioning system uses TestResourceManager
objects in order to create and drop databases, schemas,
and manage transactional testing. A new series of objects
to support transparent transaction containers within
tests is added as well.
partially implement bp: long-lived-transactionalized-db-fixtures
Partial-Bug: #1339206
Change-Id: I16bfa3af0e1ad6a9231ea38dea7cd76092347f55
|
| |
| |
| |
| | |
Change-Id: I5430adda717798e4ec31edbeab4e9aa72e5f80fa
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
test_trace test cannot pass with mocked do_execute on pypy
environment. Allow test to call do_execute with correct sql
query.
Change-Id: I165fc4de9f4a7f10cb45e92301652224e63f113b
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Removing global engine object introduces some changes
to migration api.
Basically we need to move engine creation to outer scope.
In order to address these issues we need to refactor alembic api.
Co-Authored-By: Dmitry Shulyak <dshulyak@mirantis.com>
Adopted from Ia2f9586c4e9c31339dd7dcd9f45a58e8a8409921
Change-Id: Ic7dcf1d2f38388bd1e5a517ce60190bff499686a
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch implements the drop_all_objects() portion
of the testresources series of changes, so that this
utility is usable right now. In particular, as SQLAlchemy 1.0
will support reflection of foreign key names in SQLite,
it's necessary that we don't emit a DROP CONSTRAINT
for these against SQLite as SQLite does not support
this command.
The drop_all_objects() is added as a first class element
here and is also added to the _cleanup() method of
the test_migrations base.
Tests are added which exercise the case of mutually-dependent
foreign keys on Postgresql and MySQL as well.
partially implement bp: long-lived-transactionalized-db-fixtures
Partial-Bug: #1339206
Change-Id: I56777834187651f5ba2e43482546c2981524b11c
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Improve retrying decorator such that wrapped code could request
retry attempt in the arbitrary conditions by raising RetryRequest
exception. Wrapped code should provide inner exception that is
raised when amount of retries are exceeded.
Change-Id: I596fea8dc798a11fcdfdd69208af3313f41d755b
|
|/ /
| |
| |
| |
| |
| |
| | |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: I7e41fa70f5ec315f477e72beac2a705f04c1f710
|
|\ \ |
|
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Add a decorator retry_on_deadlock(). All db.api functions marked
with this decorator will be retried if a DBDeadlock exception is
received.
Change-Id: I3488bfec67ec1c563292f1b61a7a9697f118809c
Closes-bug: 1348588
|
|\ \ |
|
| | |
| | |
| | |
| | | |
Change-Id: I797f4532e39a700e70a2834ac299663118c608cc
|
|\ \ \
| |/ /
|/| | |
|
| |/
| |
| |
| |
| | |
Change-Id: Ieabcf541bd5f2e6706159efe9d6ac54c7376004c
Closes-Bug: 1413277
|
|/
|
|
|
| |
Change-Id: I4ec9b2a310471e4e07867073e9577731ac34027d
Blueprint: drop-namespace-packages
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The second call to connection.scalar() inside of _connect_ping_listener()
is not subject to the exc_filters system under SQLAlchemy 0.9 and earlier,
in the case that the attempt to revalidate within fails. This causes
the exception to be propagated outwards as the original
OperationalError (assuming that's what the DBAPI raised, as is typical),
rather than it being wrapped again in DBConnectionError.
SQLAlchemy 1.0 has altered this behavior such that the handle_error()
listener is invoked correctly for revalidiation attempts (it was being
invoked before, but without the correct state), as well as
for initial connect attempts, as part of
https://bitbucket.org/zzzeek/sqlalchemy/issue/3266/. For 0.9 and earlier,
we here backport this system into oslo/db/sqlalchemy/compat.py,
including that we redefine the connection pool's handler to re-throw
the original dbapi.Error instance directly, then move the handling
of this error in terms of SQLAlchemy wrapping and events into
the Engine and Connection. The approach here works back to
SQLAlchemy 0.8, and is conditional based on whether or not
SQLAlchemy 1.0 is detected.
Change-Id: I455e957b043318a8500909c66cadde53228b52d6
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This method was prematurely removed from oslo.db without
a deprecation phase, when Alembic added support for
foreign key autodetection. oslo.db continues to use
alembic for this purpose, however the
ModelsMigrationsSync.check_foreign_keys() method is restored
directly for those projects which were calling into it
explicitly.
Change-Id: Id892567bd60d6b4b88765bbfe3cd5c5e75910b25
|
|\ |
|