summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Updated from global requirementsjuno-eolstable/junoOpenStack Proposal Bot2015-09-251-1/+1
| | | | Change-Id: Ia8ae7b3ce764386c2d0deb0457e2b2c063d2a886
* Updated from global requirementsOpenStack Proposal Bot2015-07-283-20/+19
| | | | Change-Id: I704716348638670abf3e3d8209f907a666fab267
* Updated from global requirementsOpenStack Proposal Bot2015-04-081-5/+5
| | | | Change-Id: I3cc08811a0387f5463fc69f1ea7c83239dcc4c9a
* Updated from global requirementsOpenStack Proposal Bot2015-02-122-13/+13
| | | | Change-Id: I2676bbf9de1cb9f9d247e99af343033a2b33b036
* Updated from global requirementsOpenStack Proposal Bot2015-01-141-1/+1
| | | | Change-Id: I0341d7979526520189568ab2d4c7aabb08e9ea89
* Updated from global requirements1.0.3OpenStack Proposal Bot2014-12-142-2/+2
| | | | Change-Id: I985865a921f0ef1997eec9b407e7d5c24ce96f39
* Repair include_object to accommodate new objectsMike Bayer2014-11-281-2/+5
| | | | | | | | | | | | | | 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 (cherry picked from commit 549ba15e3055d269c6323e6b8b6d072925ad0007)
* Updated from global requirementsOpenStack Proposal Bot2014-11-052-6/+6
| | | | Change-Id: I6d696d976a5693c046b707b990b950550325a893
* Ensure create_engine() retries the initial connection testRoman Podoliaka2014-10-072-22/+47
| | | | | | | | | | | | | | Before return create_engine() tests the connectivity to a DB. At this moment a DB might be unavailable for some reason, in which case create_engine() retries a few times. When used with MySQL, we didn't actually retry, but instead failed on the first connectivity error when trying to get the value of sql_mode session variable. Closes-Bug: #1376211 Co-Authored-By: Mike Bayer <mike_mp@zzzcomputing.com> Change-Id: I14e25cfe1ed51b0d51a94e491b7267f26e42d34e (cherry picked from commit 01a54cc5cc43c8b497007dbb07c78dacd03c1ed2)
* Move begin ping listener to a connect listener1.0.2Mike Bayer2014-09-307-14/+160
| | | | | | | | | | | | | | | | | | The "reconnect" listener that occurs on transaction begin is not sufficient for libraries that use engines, connections and sessions in "autocommit" mode, where no transaction is begun. So we move our "ping" from the begin phase to the "connect" phase instead. We use a newer SQLAlchemy event "engine_connect" so that we can make use of the Connection and all the disconnect/ invalidation facilities that are included, rather than using the low-level pool listener which is somewhat legacy. Since the event was added in SQLAlchemy 0.9.0, a compatibility layer is added which emulates the mechanics of the handle_error compatibility layer. Change-Id: I719fe45e657e747e5f8d64f20059e2b61c79b63d Closes-bug: #1374497 (cherry picked from commit 228531013b4121531777878659e6e573029bacbc)
* Merge "Fixup Fixtures Use in db test classes."1.0.1Jenkins2014-09-201-27/+20
|\
| * Fixup Fixtures Use in db test classes.Sean Dague2014-09-191-27/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With Fixture objects and test cases it is important to upcall first rather than later to allow base classes to configure their internal test tracking state. Failing to do so allows bugs like this one to occur - when failure occurs early, the state required to gather environmental details about the failure is not prepared, and the test machinery will raise secondary exceptions as it tries to do that. This may even obscure the original error. I've taken a fairly minimal approach here - I think it would be possible and likely even desirable to get rid of the test classes altogether - this module appears to have very little, if any, actual test code - its all glue for managing the test database connections. However I know zzzeek is working on a fairly large reorg in this area and I don't want to conceptually clash with that - we can do further cleanups later. Co-Authored-By: Robert Collins <rbtcollins@hp.com> Change-Id: Ic9f24aa2352d097a10be8420b701fa9f588b21b0 Closes-Bug: #1330763
* | Merge "Add a check for SQLite transactional state"1.0.00.5.0Jenkins2014-09-151-2/+11
|\ \
| * | Add a check for SQLite transactional stateMike Bayer2014-09-091-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we intercept SQLite transactions for BEGIN, check a marker that we place there to indicate BEGIN has already been called, which we then remove on commit or rollback. This is to resolve the issue of the fact that we currently use the StaticPool implementation with SQLite, which shares a single SQLite connection for all requests; any API method which makes use of multiple sessions at once (not a good idea, but this is prevalent throughout nova, neutron) will therefore share the same SQLite connection with multiple SQLAlchemy Connection wrappers that are not aware of the existing state. While this practice should be corrected, for now the marker, which is local to the SQLite connection as stored by the pool, will track when BEGIN is safe to call, or has already been called. Change-Id: I70d44104412bd99d8c7713eb6cd9ff0f80c5da34 Closes-Bug: #1367354
* | | Merge "Updated from global requirements"Jenkins2014-09-132-5/+5
|\ \ \
| * | | Updated from global requirementsOpenStack Proposal Bot2014-09-132-5/+5
| | | | | | | | | | | | | | | | Change-Id: Ia959fbf504268aa13e077cb2637fc14367deb247
* | | | Merge "Imported Translations from Transifex"Jenkins2014-09-135-0/+242
|\ \ \ \
| * | | | Imported Translations from TransifexOpenStack Proposal Bot2014-09-125-0/+242
| |/ / / | | | | | | | | | | | | Change-Id: Idb877c59f277ccda8068d83445e43550da235038
* | | | Merge "Clean up documentation"Jenkins2014-09-1321-38/+145
|\ \ \ \ | |/ / / |/| | |
| * | | Clean up documentationDoug Hellmann2014-09-0421-38/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to manually generated rst files for the API documentation so we do not expose private parts of the library. Fix formatting of usage.rst Convert bullet list to section headers to fix rendering issues and make the docs more readable. Fix formatting of docstrings in classes exposed in the docs to eliminate warnings/errors from Sphinx. Add history.rst Change-Id: I6f500775f801558f7c0c29f180b60f83a7150e02
* | | | Merge "Fix DBReferenceError on MySQL and SQLite"Jenkins2014-09-112-73/+98
|\ \ \ \ | |_|_|/ |/| | |
| * | | Fix DBReferenceError on MySQL and SQLiteJulien Danjou2014-09-052-73/+98
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It turns out the test was wrong as the error message used was not a good one. Real world tests showed that, so I've updated the test and the code to work. Refactored tests to use real backends, fix error message for SQLite. Co-Authored-By: Victor Sergeyev <vsergeyev@mirantis.com> Change-Id: Ifa64478a9ac9ed0a3c317a8974615b770c85f313
* | | Merge "Use single quotes for db schema sanity check"Jenkins2014-09-111-1/+1
|\ \ \ | |_|/ |/| |
| * | Use single quotes for db schema sanity checkHuai Jiang2014-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | double quotes would cause failure when mysql running on ANSI sql_mode. Change-Id: I891b61035ecb90b91a9ccdbec14dd567c575299b Closes-Bug:1365019
* | | Merge "Renaming in WalkVersionsMixin"Jenkins2014-09-092-40/+64
|\ \ \
| * | | Renaming in WalkVersionsMixinOleksii Chuprykov2014-09-052-40/+64
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename _walk_versions(), _migrate_up(), _migrate_down() and mark them deprecated as they will be removed in few releases. These functions will be the part of public API as this class will be used for migrations in other OpenStack projects, so there is no need to make them 'private'. Change-Id: Ic9358445e60a0dd43a5900e8bda7b12f2bebf679
* | | Merge "warn against sorting requirements"Jenkins2014-09-082-0/+8
|\ \ \
| * | | warn against sorting requirementsDoug Hellmann2014-09-032-0/+8
| |/ / | | | | | | | | | | | | Change-Id: I64ae9191863564e278a35d42ec9cd743a233028e Addresses-Bug: #1365061
* | | Let oslotest manage the six.move setting for moxDoug Hellmann2014-09-071-5/+0
| |/ |/| | | | | | | | | | | | | | | | | This instruction to set up a move in six for the mox module conflicts with the one in oslotest. We are trying to use mox3 everywhere, so remove this instruction and let oslotest handle it. Imported from the incubator change with the same ID. Change-Id: I59d5799283233f8411044ddb15c8abfc8850014c
* | ModelsMigrationsSync:Override compare_server_defaultAnn Kamyshnikova2014-09-032-4/+34
|/ | | | | | | | | | | | | | | This test showed an error with alembic 0.6.6: For MySQL Integer server_default value is compared incorrectly. For example, when model has DefaultClause('0', for_update=False) alembic finds it different from server variant "'0'". For PostgreSQL Sting server_default value is compared incorrectly. For example, when model has DefaultClause('', for_update=False) alembic finds it different from server variant "''::character varying". Such error appear in implementation of ModelsMigrationsSync to Neutron https://review.openstack.org/76520. Change-Id: I9730da1c0790a88f81570c51c36cc0cbe0651a5a
* Merge "Updated from global requirements"Jenkins2014-09-031-1/+1
|\
| * Updated from global requirementsOpenStack Proposal Bot2014-09-021-1/+1
| | | | | | | | Change-Id: Ic7d77a737d3e16f4f781baebe8ce57d04db04832
* | Merge "Add doc8 to tox environment docs"Jenkins2014-09-024-6/+8
|\ \
| * | Add doc8 to tox environment docsChristian Berendt2014-09-014-6/+8
| | | | | | | | | | | | | | | | | | Check reStructuredText documents for common style issues. Change-Id: I10e61742e86d2d4781c5a00532c8e17d38a7d4b4
* | | Imported Translations from TransifexOpenStack Proposal Bot2014-09-021-22/+12
| |/ |/| | | | | Change-Id: Ic2108aab91b04e337f6a68e0275ec2806dc1a3e8
* | Merge "Use oslo.i18n"Jenkins2014-09-0214-460/+46
|\ \
| * | Use oslo.i18nAndrey Kurilin2014-09-0114-460/+46
| |/ | | | | | | | | | | | | Module `gettextutils` from common code was graduated to oslo.i18n, so it would be great if we reuse this library. Change-Id: Ie5836b82723fc80c1d54e5e65eac8565cf905c5a
* | Repair pysqlite transaction supportMike Bayer2014-08-282-0/+93
|/ | | | | | | | | | | | | | | | | This patch applies the events discussed in SQLAlchemy documentation at http://docs.sqlalchemy.org/en/rel_0_9/dialects/sqlite.html#serializable-isolation-savepoints-transactional-ddl which correct for pysqlite's modifications to SQLite's transactional cycle. We turn off pysqlite's automatic emit of BEGIN as well as COMMIT before any DDL, and instead emit our own BEGIN at the point where SQLAlchemy knows a transaction is to start. A proof of concept is added to illustrate SAVEPOINT working completely. SAVEPOINT support will be needed in order to support transactional testing with rollbacks inside of tests. Change-Id: Ie39bd2287173327903523b66160653608d9e8652
* Extract logging setup into a separate functionRoman Vasilets2014-08-261-9/+20
| | | | Change-Id: I9f1761a5332ad3c4a8f0b76c6f46fc687fd61aa5
* Merge "Updated from global requirements"Jenkins2014-08-242-3/+3
|\
| * Updated from global requirementsOpenStack Proposal Bot2014-08-222-3/+3
| | | | | | | | Change-Id: I834ba5e6a6d583370099b5c87d28680a67a802c1
* | Merge "Remove reliance on create_engine() from TestsExceptionFilter"Jenkins2014-08-231-1/+10
|\ \
| * | Remove reliance on create_engine() from TestsExceptionFilterMike Bayer2014-08-211-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we are continuing to add functionality to create_engine() which in some cases means that backend-specific SQL is emitted on connect, the practice of repurposing a SQLite or other engine to act like another one for the purposes of a test is becoming less feasible. Here, TestsExceptionFilter is altered to not rely upon the full session.create_engine() process for unit tests, instead calling upon just those listeners being tested. Change-Id: I0ece42f956c59eab7a6cb86419d8d359250d5e71
* | | Merge "Consolidate sqlite and mysql event listeners"Jenkins2014-08-232-328/+195
|\ \ \ | |/ / | | / | |/ |/|
| * Consolidate sqlite and mysql event listenersMike Bayer2014-08-212-328/+195
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch refactors the SQLite and MySQL event listener setup in session.py to occur inline within the new _init_events() hooks for each of these backends. This is to improve code readability and reduce unneeded boilerplate. In particular, _mysql_set_mode_callback() was implemented using four functions, all private to session.py, unused anywhere else and also not consistently prefixed with "_mysql". These functions have been consolidated into a single event listen plus a quick check of SQL mode. In particular, the system now emits the logging check for "sql_mode" in all cases. On the SQLite side, three functions, again not all prefixed with _sqlite, are consolidated into a single event listening function wihtin _init_events(). The test suite is altered in several ways. The tests for connect arguments no longer inject a sqlite engine into session.create_engine(); now that MySQL does a particular statement every time, this was no longer feasible, and in general other setup functions might emit SQL also, so the CreateEngineTest tests now test directly into session._init_connection_args. The tests for MySQL modes and SQLite connection settings move into being plain round-trip tests, reducing lots of mocking logic and ultimately doing a more complete test against a real backend. Change-Id: I04ca3fbb1f46a64ed6552496ae995f77aa0b2315
* | Merge "Added check to see whether oslotest is installed"Jenkins2014-08-221-1/+7
|\ \ | |/ |/|
| * Added check to see whether oslotest is installedOleksii Chuprykov2014-08-201-1/+7
| | | | | | | | | | | | | | | | | | The projects that are using oslo.db in tests need to explicitly include oslotest in their test-requirements. Closes-bug: 1356425 Change-Id: I0ed01e141221d19af5593857c13a656f32d0f3cf
* | Use dialect dispatch for engine initiailization.Mike Bayer2014-08-212-37/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes use of the new DialectFunctionDispatcher to remove all conditional logic from within session.create_engine(). The flags that result in various engine connect arguments as well as subsequent event listeners now fall under the realm of dispatched functions keyed to their target dialects. Additionally, this modernizes the SQLite foreign keys listener to use events. A test suite is added which via mocks asserts that arguments expected to be present as well as non-present for a variety of url situations is added. Change-Id: Iba5e77e1396eda46ac2c6d6cbca159cbfadf4d04
* | Add get_non_innodb_tables() to utilsVlad Okhrimenko2014-08-212-0/+77
| | | | | | | | | | | | | | | | Add a helper function to utils for detection of tables which aren't using InnoDB storage engine in MySQL (something we want to enforce in consuming projects). Change-Id: I22889e23b025fc32fe76e4086cd3cd3d5bd0b771
* | Merge "Implement a dialect-level function dispatch system"0.4.0Jenkins2014-08-202-0/+451
|\ \ | |/ |/|