summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge "docs: mention that it's possible to use Connection directly"4.17.0Jenkins2017-01-041-0/+15
|\
| * docs: mention that it's possible to use Connection directlyRoman Podoliaka2016-12-121-0/+15
| | | | | | | | | | | | | | | | Sometimes people just do not need the ORM part and a Session at all. Mention the fact, that it's possible to ask for a Connection in enginefacade. Change-Id: I7a135be7149cd3fa140e0268fea5a17f23f402b2
* | Modify word "whetever" to "whether"ahdj0072016-12-291-1/+1
| | | | | | | | Change-Id: I627b1fd01d01d79ed4a4fe131f5edec733703635
* | Updated from global requirementsOpenStack Proposal Bot2016-12-221-1/+1
| | | | | | | | Change-Id: I30a9d74d90479d8d335dd2e1f097b1fcefd53cf8
* | Merge "Add Constraints support"Jenkins2016-12-212-1/+34
|\ \
| * | Add Constraints supportTony Breeds2016-12-202-1/+34
| |/ | | | | | | | | | | | | | | | | | | | | | | Adding constraints support to libraries is slightly more complex than services as the libraries themselves are listed in upper-constraints.txt which leads to errors that you can't install a specific version and a constrained version. This change adds constraints support by also adding a helper script to edit the constraints to remove oslo.db. Change-Id: I31febfe00698e36f4c2e0e41c3f7bf64acf47adf
* | Support packet sequence wrong errorMike Bayer2016-12-142-0/+9
|/ | | | | | | | | | | | | | | | In I484237c28a83783689bb8484152476de33f20e3a, we observed MariaDB-specific error code 1927 as a new kind of disconnect situation. In some failure-mode testing we are also observing with PyMySQL that a stale connection, when it is attempted to be used for the initial ping, does not return any error code but instead trips up PyMySQL with packets sequence numbers (this is an internal value used by the MySQL client/server protocol to track messages). The connection is definitely not recoverable in this state so this also needs to be a disconnect situation so that the ping listener refreshes the connection pool. Change-Id: Iee1c4533e2457acc30e2046b63145c2502012c5f References: https://bugs.launchpad.net/tripleo/+bug/1642944
* Merge "Replaces uuid.uuid4 with uuidutils.generate_uuid()"Jenkins2016-12-091-5/+4
|\
| * Replaces uuid.uuid4 with uuidutils.generate_uuid()zhangguoqing2016-12-071-5/+4
| | | | | | | | | | | | | | | | Openstack common has a wrapper for generating uuids. We should use that function when generating uuids for consistency. Change-Id: I927609f06e5921e189487160ef46be830e422add Closes-Bug: #1082248
* | exc_filters: fix deadlock detection for percona xtradb clusterRoman Podoliaka2016-12-092-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | percona xtradb cluster server produces an error like: (1213, u'WSREP detected deadlock/conflict and aborted the transaction. Try restarting the transaction') which is currently not detected properly and, thus, not retried. Closes-Bug: #1648818 Change-Id: Ic43cb0e0946506a4b7ce9f94ee9eba5e025ed3d5
* | Merge "Strip prefix `migrate_` in parameter `migrate_engine`"Jenkins2016-12-071-63/+60
|\ \
| * | Strip prefix `migrate_` in parameter `migrate_engine`int32bit2016-12-051-63/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | This code was initially taken from Nova migrate_repo, the prefix of 'migrate_' in argument 'migrate_engine' makes no sense in this place, but a little misleading. So we should strip the prefix and use 'engine' instead. Change-Id: I6460eca03eb135c98d22d066b57b17907df7237c
* | | Fix marker checking when value is Nonetengqm2016-12-062-14/+52
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are cases where users sort a table using compound-values sort_key and one of the key has nullable set to True. For example, sorting a table using ['id', 'updated_at'] where 'updated_at' can be None. When marker_value is None, we cannot do value comparison using '<' or '>' operators. This patch adds a check if the value from the marker corresponding to the nullable-key has None value. If that is the case, we skip the comparison. Back to the example above, instead of always getting the following criteria (which doesn't work): (id > MARKER_ID) or (id == MARKER_ID && updated_at > None) <-- failure we will get the following criteria when 'updated_at' is None: (id > MARKER_ID) This is not hurting in any way to existing / legal use cases where callers are expected to include a unique key in sort keys. If there are such cases, this patch is not making things worse because the sorting is already unpredictable. Closes-Bug: #1615938 Change-Id: Iea2cd0bb2556b0b15a0baaa76ef522a3097f9928
* | migration: don't assume the mixin use provision4.16.0Mehdi Abaakouk2016-12-051-5/+4
|/ | | | | | | | | | | | | | | | | | In 2ad571c8d7a7e1d8d18f7c5e97c564509fd34816 we have changed the backend used to cleanup the ModelsMigrationsSync by the one from oslo_db.sqlalchemy.provision. But in ModelsMigrationsSync, nothing uses the provisioning system. The engine can be created outside oslo.db. And oslo.db must must not assume it have been created by the oslo_db.sqlalchemy.provision module. For example, 2ad571c8d7a7e1d8d18f7c5e97c564509fd34816 have broken the Gnocchi models migration test that creates the engine itself. This change builds a new backend to cleanup all database objects. Change-Id: Ie8c454528ce3aa816c04fbb4beb69f4b5ec57e9c Closes-bug: #1647280
* Merge "Check if an index on given columns exists"Jenkins2016-12-022-12/+48
|\
| * Check if an index on given columns existsint32bit2016-12-012-12/+48
| | | | | | | | | | | | | | | | | | | | | | | | We have many cases to check if an index exists on a given columns. Like: "https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/ migrate_repo/versions/347_add_updated_at_index.py#L30-L37" In addition, It's very frequent to get all indexes from a table, so we need a reusable function to avoid duplicate effort. Change-Id: Iadd9b6ac7586e9b50357ca799eb605f4772e0ece
* | Merge "Show team and repo badges on README"Jenkins2016-12-011-0/+9
|\ \
| * | Show team and repo badges on READMEFlavio Percoco2016-11-251-0/+9
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the team's and repository's badges to the README file. The motivation behind this is to communicate the project status and features at first glance. For more information about this effort, please read this email thread: http://lists.openstack.org/pipermail/openstack-dev/2016-October/105562.html To see an example of how this would look like check: b'https://gist.github.com/f4852cbe9049c5a5d7241af3102c88ea\n' Change-Id: I17dc5cacb22da5f37cbf92095c4144525cd5724b
* | Ensure provision_new_database is True by default4.15.0Mike Bayer2016-11-292-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In I3e238b6a97769cf0a352f11e718d5d73eebcfa8a, we restored zzzeek's overlooking the fact that legacy test suites assume new DBs are provisioned by default in the legacy test base. However, zzzeek also made this same assumption in Neutron Ie27cf174fa24c2f479af47335d9ae139fb7d159a which vendors its own version of test_base in anticipation of some of these newer features, so it will break once the provision_new_database flag becomes false. Favor setting this flag True/False explicitly and default it to True for compatibility w/ Neutron. Change-Id: I726cc20481a9bc778b75564526d9245132b43563
* | Don't run LegacyBaseClass provision test for unavailable databaseMike Bayer2016-11-291-12/+24
| | | | | | | | | | | | | | | | | | | | The test added in I3e238b6a97769cf0a352f11e718d5d73eebcfa8a will fail if the corresponding backend is not actually available, because the resources dictionary will be empty. Add a skip mechanism based on whether or not the DatabaseResource has backend available or not. Change-Id: I0ecb4a7ba6531b50c9c3abc6c9c8564b0df54f61
* | SoftDeleteMixin: allow for None valuesRoman Podoliaka2016-11-282-1/+22
| | | | | | | | | | | | | | | | | | | | | | This is a fixup for I13c6233cfeb611b1b106eedfc9b57d2af313c46b to address the remaining comments: - allow for None values to be passed (as column deleted is nullable) - document why column deleted is not of type boolean Change-Id: I04f690f7a1bb8cb14f1e3322643a8cf8bc9c549a
* | SoftDeleteMixin: coerce deleted param to be an integerRoman Podoliaka2016-11-283-3/+72
|/ | | | | | | | | | | | | | | | | PostgreSQL is very strict about types and won't perform an automatic type cast when trying to pass e.g. a boolean `false` value to be INSERT'ed or UPDATE'ed. Coerce the value of deleted bound parameter to always be an integer in the DB layer by adding a custom SQLAlchemy integer type decorator to make PostgreSQL happy, should someone pass a boolean value for deleted column (it was meant to be of boolean type, but is integer instead to allow for Nova use case of shadow tables and compound unique constraints on something + deleted). Closes-Bug: #1644513 Change-Id: I13c6233cfeb611b1b106eedfc9b57d2af313c46b
* Support MariaDB error 1927Mike Bayer2016-11-212-0/+9
| | | | | | | | | | | | We're observing a MariaDB-specific error code "1927 connection was killed", which seems to indicate the condition where the client/server connectivity is still up but the mariadb server has been restarted. This error needs to be supported as one of the "disconnect" situations so that the ping handler knows to force a reconnect. Change-Id: I484237c28a83783689bb8484152476de33f20e3a References: https://bugs.launchpad.net/tripleo/+bug/1642944
* Merge "Break optimize_db_test_loader into package and module level"Jenkins2016-11-203-39/+166
|\
| * Break optimize_db_test_loader into package and module levelMike Bayer2016-11-163-39/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This unittest-compatible load_tests function was not well organized for package-level tests and was broken for module-level usage; as in the case of module-level usage, the "pattern" parameter was being passed, which was unexpected since the Python 2.7 documentation for unittest claims it will be None. However, we are using subunit to run tests, which uses the unittest2 library that achieves compatibility with Python 3 - in Python 3, the documentation was changed here to note that "pattern" may be present (and in fact it is). Instead, break it into optimize_package_test_loader and optimize_module_test_loader. The former assumes placement inside of __init__.py only and the latter assumes placement inside of a specific module only. The issue with this function was observed when trying to get OptimisingTestSuite to work correctly with neutron; tests would be duplicated due to the double-search. In local testing it was shown that the function could cause recursion overflows. It has been observed that using this function at the module level is of great use when running subsets of tests, since the package-level load_tests function is not consulted unless the test run is package-wide. Change-Id: I267fd2fbc16504c11addef870fc8d4fc500da7d9
* | Merge "Adjust SAVEPOINT cause test for SQLA 1.1"Jenkins2016-11-202-13/+29
|\ \
| * | Adjust SAVEPOINT cause test for SQLA 1.1Mike Bayer2016-11-162-13/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SQLAlchemy 1.1 has repaired some of the failure modes for Session.rollback(), including the MySQL case where the savepoint identifier gets lost, such that the Session is in a more usable state than before. A side effect of this is that the test here in oslo.db only hits a single error handler, not two. SQLAlchemy upstream is described at: https://docs.sqlalchemy.org/en/latest/changelog/migration_11.html#improved-session-state-when-a-savepoint-is-cancelled-by-the-database Change-Id: I324f288701e9ffd241de638e0e0419dc8d9c1264
* | | Updated from global requirementsOpenStack Proposal Bot2016-11-161-1/+1
| |/ |/| | | | | Change-Id: I65eb5fad2269e81c74e2a73e8bbd50b2ed8fb539
* | Restore provisioning of DBs in legacy test baseRoman Podoliaka2016-11-152-1/+18
|/ | | | | | | | | | Apparentely I0163e637ffef6d45d2573ebe29b5438911d01fce breaks Nova tests, as we no longer provision a new DB in DatabaseResource by default. While the recommended way is to use the new fixtures, we should make sure the original behavior is preserved for the legacy test cases. Change-Id: I3e238b6a97769cf0a352f11e718d5d73eebcfa8a
* Merge "utils: deprecate InsertFromSelect properly"Jenkins2016-11-102-4/+12
|\
| * utils: deprecate InsertFromSelect properlyRoman Podoliaka2016-11-042-4/+12
| | | | | | | | | | | | | | | | | | | | This is provided out-of-box by SQLAlchemy versions >= 1.0.0. We've had this class deprecated in docs for some time now, now do it properly by the means of debtcollector and a release note. Closes-Bug: #1439092 Change-Id: I562c35c265014c6b19a81961f236a7a0ca438765
* | Updated from global requirementsOpenStack Proposal Bot2016-11-091-1/+1
| | | | | | | | Change-Id: I86d5d8f41a6b51faac74d155472379e8bd34cab1
* | Merge "Enhanced fixtures for enginefacade-based provisioning"Jenkins2016-11-0919-39/+916
|\ \
| * | Enhanced fixtures for enginefacade-based provisioningMike Bayer2016-11-0419-39/+916
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original idea of enginefacade was that applications would call upon the global _TransactionContextManager given in oslo_db.sqlalchemy.enginefacade. However, as it turns out, virtually no Openstack projects seem to be using that technique, and instead, everyone is creating their own ad-hoc _TransactionContextManager objects and usually establishing it as a module-level global. Nova has two of them. Additionally, projects add configuration to these enginefacades (which IS part of the original idea), and this configuration in some cases is necessary to be present for tests that run as well, a key example being the sqlite_fks flag. The original DbFixture integration provided no way of reusing this configuration. Finally, projects very much tend to use custom fixtures in order to define their database communication. Test classes themselves don't really make use of oslo_db's DbTestCase anymore. This patch introduces a modernized fixture system which, in conjunction with the recent provisioning patch, addresses these use cases. Applications will typically create their own subclasses of these fixtures up front to suit the various testing cases they have, including SQLite fixed, SQLite ad-hoc, and opportunistic. In order to accommodate the fixture-based flow along with the use of testresources for opportunistic database provisioning, a mixin class OpportunisticDbTestMixin is still needed when a test needs to use "opportunistic" testing in order to provide the .resources attribute. The calculation of .resources is moved into the fixture system, but because this attribute is consulted before setUp(), the "opportunistic" fixture must be created early and stored. Closes-Bug: #1548960 Change-Id: I0163e637ffef6d45d2573ebe29b5438911d01fce
* | | Updated from global requirementsOpenStack Proposal Bot2016-11-061-1/+1
|/ / | | | | | | Change-Id: If4eac84ef561183e083a24e67fb14eb793b34db2
* | Merge "Updated from global requirements"Jenkins2016-11-041-1/+1
|\ \
| * | Updated from global requirementsOpenStack Proposal Bot2016-11-041-1/+1
| |/ | | | | | | Change-Id: Idf8159061ff6ff2eaab88f117b1063661a93aeed
* | Using new style assertions instead of old style assertionshowardlee2016-11-044-23/+23
|/ | | | | | | | Replace 'assertTrue(a in b)' with 'assertIn(a, b)'. Replace 'assertTrue(a not in b)' with 'assertNotIn(a, b)'. Replace 'assertFalse(a in b)' with 'assertNotIn(a, b)'. Change-Id: Ifcb490481ed58b0223029cc257b22a53ad0e5a42
* Fix exc_filters for mysql-pythonRoman Podoliaka2016-11-032-2/+17
| | | | | | | | | | | | | | | | Something changed in mysql-python / libmysqlclient or mysql and now exceptions that used to be InternalError's have become OperationalError's. Update filters accordingly to wrap those into oslo.db exceptions properly. OperationalError's are kind of special, as we re-raise them as is due to historical reasons: we need to make sure that at least SAVEPOINT errors are wrapped, as that's what oslo.db and neutron unit tests expect. Closes-Bug: #1630899 Change-Id: I39ea8c4a0dc9d43992f00da7b1ff502595b4dc13
* Updated from global requirementsOpenStack Proposal Bot2016-10-272-3/+3
| | | | Change-Id: Ib8d4e83db6d348e0630e1c60d93424784c20f0a9
* Merge "OpenStack typo"Jenkins2016-10-261-1/+1
|\
| * OpenStack typomelissaml2016-10-241-1/+1
| | | | | | | | | | | | | | | | According to the word choice convention in http://docs.openstack.org/contributor-guide/writing-style/word-choice.html We should use OpenStack instead of Openstack. Change-Id: Iff28b4c60c10f1f320172d20f9d9c41021d48eca
* | Merge "Change assertTrue(isinstance()) by optimal assert"Jenkins2016-10-261-5/+5
|\ \
| * | Change assertTrue(isinstance()) by optimal assertTony Xu2016-10-251-5/+5
| |/ | | | | | | | | | | Use assertIsInstance() instead of assertTrue(isinstance()) Change-Id: I47c75200a8c628779a96563c3982472743cbf4f9
* | Changed the home-page linkmelissaml2016-10-161-1/+1
|/ | | | | | Set the correct link for home-page. Change-Id: I45063b8cb3381b1e13b265e0e846d47691fc127c
* standardize release note page ordering4.14.0Doug Hellmann2016-10-121-2/+2
| | | | | | | | | | In order to support automatically updating the release notes when we create stable branches, we want the pages to be in a standard order. This patch updates the order to be reverse chronological, so the most recent notes appear at the top. Change-Id: Ib364dcc8eb31275a31c83b68d7914263b183e393 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* Merge "Enable release notes translation"Jenkins2016-10-121-0/+3
|\
| * Enable release notes translationAndreas Jaeger2016-10-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | Releasenote translation publishing is being prepared. 'locale_dirs' needs to be defined in conf.py to generate translated version of the release notes. Note that this repository might not get translated release notes - or no translations at all - but we add the entry here nevertheless to prepare for it. Change-Id: I723a3e5f79db0e2fe0ff22795a5200391c967bff
* | Merge "Add DBDataError for "Data too long""Jenkins2016-10-122-0/+8
|\ \
| * | Add DBDataError for "Data too long"Eric Harney2016-10-032-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This classifies the error that occurs when data is inserted that is too long for the VARCHAR's maximum length. Related-Bug: #1608849 Change-Id: I6e129d64b7eb68a0057e6b14baa39c72674a1fff