| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The two regexp-based filters in exc_filters.py->_is_db_connection_error()
were both incorrectly formed. The tests for these filters would pass
because the fixture also set the is_disconnect flag to True, which
normally would be set by SQLAlchemy, and therefore the
_raise_operational_errors_directly_filter() or possibly
the _raise_for_remaining_DBAPIError() filters would catch this,
view the is_disconnect flag as True, and promote to a DBConnectionError.
However, the _is_db_connection_error() filters are intended to
work independently of whether this flag is set; so two new tests
are added which unset the flag, and ensure that the exception messages
as given are caught here.
Change-Id: I37ddd669b89669730ae1ff07c7bc7a6ba5705f67
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch applies upgrades to the sqlalchemy/exc_filters.py and
sqlalchemy/compat/handle_error.py compatibility layers to accommodate
new changes in SQLAlchemy 1.0. SQLA 1.0 will now route errors that
occur upon connect through the handle_error() event, just like any other,
so that when 1.0 is present we no longer need to use
exc_filters.handle_connect_error; the method becomes a passthrough
as far as running the event handler. Additionally, SQLAlchemy 1.0
has added the "engine" parameter to ExceptionContext, specifically
to suit the case when the initial connect has failed and there is
no Connection object; the compatibility layer here now emulates
this behavior for SQLAlchemy versions prior to 1.0.
Change-Id: I61714f3c32625a621eaba501d20346519b8b12c7
|
|\ \ |
|
| | |
| | |
| | |
| | | |
Change-Id: I976f8b8a7b3d31c7046ed53f6564c58af408b1b2
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
In python3.x the 'uee' variable will be removed from the
scope after the except block exits (if it ever is entered)
so we need to use a different variable name to ensure that
it will not be deleted so we can use it later.
Change-Id: Ia86a2bd1a46e57eaf47704eadc991fd0c9b08661
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Tests in TestConnectionUtils class depends on database and DB connector,
so the simplest way to run them with python 3.X is to use same database
and connector for the both python versions. PostgreSQL and psycopg2 are
looks good for this.
Replaced ``mysql`` to ``postgresql`` in TestConnectionUtils.
Change-Id: Icb1d6324b58feed515e4eb885715cbf2195768cf
|
|\ \ \
| |/ /
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Use __lt__ insted of __cmp__ for py3 compatability.
Change-Id: I85d8eeb2cbb754b72b04c817f49d3a62f1473994
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
nested() should return enter_context instead of
nothing.
Change-Id: I910eace453d07e2f9a12dd0ce0eca22f4d155472
|
| |_|/
|/| |
| | |
| | | |
Change-Id: I3443352b9ec847534cf4016dc540da769501593b
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Replace URLs for workflow documentation to appropriate parts of the
OpenStack Project Infrastructure Manual.
Change-Id: I318dea15e0d2f7ef22427fe22d8d57173e60e784
|
|\ \ \
| |_|/
|/| | |
|
| |/
| |
| |
| |
| |
| |
| | |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: I7e50cf461b9ff7344a00a63f35709667c9ec857b
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add a check that models.ModelBase is iterable.
Remove checking on next() method since models.modelBase
isn't actually iterator.
Remove unnecessary checks from TimestampMixinTest
Change-Id: Ibbde0e49bec25e1acddaf64f03083cf46481a581
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The tests in tests/sqlalchemy/test_migrations.py which expect
to see changes in unique constraints fail due to the
assumption that the "include_object" feature of Alembic only
deals with the 'table' and 'column' constructs. As Alembic
0.7.0 has added include_object support for 'index' and
'unique_constraint', this method should not be limiting
itself to not include objects that it's testing for.
Tests won't pass on Alembic 0.7.0 without this patch.
Change-Id: Ia71446bb8c0b248c6310534deb290524e3946987
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | | |
Change-Id: I7178fb2ca6e17d7428a44ec2cefe0634bb134634
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
Add table to diff that is generated by check_foreign_keys
function.
Change-Id: Ib771ea49e873dd87cccacf6ec7463d6e005372a3
|
|\ \ \
| |_|/
|/| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We can get 'PRIMARY KEY must be unique' error on some
platforms and versions of sqlite library while trying to
insert the row with the same primary key that already exist.
In this case oslo.db should raise DBDuplicateEntry error.
Add corresponding filter to _sqlite_dupe_key_error
Closes-Bug: #1386145
Change-Id: Ifafd6a8e0b613a31e596043071aef4d410a976f2
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | | |
Change-Id: I8a909d181302ea1c898dcdf1ce13a9e4681217f8
|
|\ \ \ \
| |/ / /
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Using nova-api in the wild shows that we've got an additional
exception, that must be treated like a deadlock, so that we
can handle this error properly and retry the transaction.
Closes-Bug: #1394298
Change-Id: If75f2b5984979fe55ad04ccec8713989307c56ae
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In python3.x the 'de' variable will be removed from the
scope after the except block exits (if it ever is entered)
so we need to use a different variable name to ensure that
it will not be deleted so we can use it later.
This avoids errors of the format:
UnboundLocalError: local variable 'de' referenced before
assignment
Change-Id: I9ea2bd6b3a8c392f8d27b0130dd6b7683fc44e7c
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
is_backend_avail() helper function calls _ensure_backenv_available()
method,which creates a SQLAlchemy engine and opens a test connection,
but doesn't call engine.dispose(). Depending on Python interpreter
version used, the connection in the pool may remain open for some
time (even though, we don't store a reference to an Engine instance).
Closes-Bug: #1393633
Co-Authored-By: Victor Sergeyev <vsergeyev@mirantis.com>
Change-Id: I0297af709ed18fed52308500c13054cb49adf401
|
|\ \ \ \ \ |
|
| | |_|/ /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Add pbr to the list of installation requirements so that it is installed
via pip before this library is installed, instead of with easy_install.
This avoids issues like Bug #1384919, and ensures that projects that use
this library as a dependency are properly installed.
Related-Bug: #1384919
Change-Id: I6c155370dbd01fe4748d5137bdf288e8d3e1a67e
|
| |/ / /
|/| | |
| | | |
| | | | |
Change-Id: Ic80266ad328243a91688bc573be7e49d026c4b1f
|
|\ \ \ \
| |_|_|/
|/| | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The tests/sqlalchemy/test_exc_filters.py tests were asserting
the exact string format of SQLAlchemy exceptions.
SQLAlchemy is improving its exception format in version 1.0,
thereby breaking these tests. Instead of supporting multiple
string formats, change the assertions to compare specific
fields per the oslo.db.exceptions and sqlalchemy.exc APIs.
Change-Id: Ie98ac3ca82a1052c463ca9ca5d41e228935497b3
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For more information about this automatic import see:
https://wiki.openstack.org/wiki/Translations/Infrastructure
Change-Id: Ic68faa63ccf1ae0af395643e97c0fc472848ac3e
|
|\ \ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This change is the first part in a series of changes
that will allow for full flexibility in database usage
during tests. The first step is to add more facility
to the oslo.db.sqlalchemy.provision system, implementing
a dispatch system that allows flexibility in creation
and dropping of databases, as well as moving the awareness
of the "openstack_citest" convention into provisioning.
The OpportunisticFixture and OpportunisticTestCase now
fold into DbFixture and DbTestCase, which defers in a simple
way to provision.ProvisionedDatabase for all connectivity.
ProvisionedDatabase in turn decides based on the given
environment as to how an engine should be provisioned
for a given test.
Control of database connectivity remains via the
OS_TEST_DBAPI_ADMIN_CONNECTION environment variable. When not
set, connectivity defaults to sqlite://, plus those backends
found to be available using "opportunistic" naming conventions.
When the variable is present, it provides a semicolon-delimited
list of URLs, and only those URLs will be used for initial
connectivity.
Future changes will allow provisioning to hold onto a single
database engine per test run, as well as allow a single
test class to run in multiple backend scenarios (e.g. one test
against many different backends).
Change-Id: Ifc02505c4c8ebd4a1ca56e14f76c0989576875c3
Partial-Bug: #1339206
|
|\ \ \ \ \ |
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Remove the specification in tox.ini that _ is a builtin so that
it will no longer assume that _ does not need to be imported.
This helps ensure that the _ from i18n is used.
Activating this check did not flag any violations.
Change-Id: Idc4d6259d4eb2db66e7122535bc42f8647049a06
|
|/ / / /
| | | |
| | | |
| | | | |
Change-Id: I83bd22b11ca85eee8fb3dedceef4d9ac00343c38
|
| |_|/
|/| |
| | |
| | | |
Change-Id: Iaed3965166e01fcaf0e9da75ffea3426cda0750e
|
|/ /
| |
| |
| | |
Change-Id: I215a53a00948b6477ba9d493df8b0ea6ef6e6d83
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| | |
Add method that checks that foreign keys in models are synchonized
with foreign keys that are created in database.
Change-Id: I4a776da0f53a79218ed4b111cac33b37d264fa1b
|