summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Correctly detect incomplete sort_keys passed to paginate_query4.13.1Ihar Hrachyshka2016-09-012-5/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the function expects that sort_keys will contain 'id', otherwise a warning is triggered. This assumption is wrong in multiple ways. First, models may not have an 'id' attribute. Second, even if the attribute is present, it may be non-unique irrespective of the name chosen for it. The right way of determining sorting keys that would not guarantee stable sorting order for paginated results is to extract sets of unique keys from the model itself, and compare sorting keys to those extracted sets. If at least one of those unique key sets is a subset of passed sorting keys, then no warning should be issued. The patch also add _get_unique_keys function but, in contrast to its Ocata version, does *not* expose it as part of library public API, and makes it explicit it's not part of it, by using the leading underscore in its name. The rationale behind that is that we don't want to expose new features in Newton if possible. The function is a modified version of a function with a similar name (get_unique_keys) currently maintained in Neutron tree for similar needs. To avoid calculating the same result over and over on each call to the new function, we cache it in info dict of the relevant Table. Change-Id: I46d9d53ee5f6fa2863b31027fa81997571d6568a Closes-Bug: #1617996 (cherry picked from commit dea700d13e4c152bf1a484b62cc2bce329ef6fa9)
* Fix DBReferenceError and DBNonExistentTable with new PyMySQL versionJulien Danjou2016-08-312-40/+17
| | | | | | | | | | PyMySQL 0.7.7 changed the string format of the error raised, making oslo.db unable to catch the error: (pymysql.err.IntegrityError) (1452, u'23000Cannot add or update a child row: a foreign key constraint fails (`vaceciqnzs`.`resource_entity`, CONSTRAINT `foo_fkey` FOREIGN KEY (`foo_id`) REFERENCES `resource_foo` (`id`))') [SQL: u'INSERT INTO resource_entity (id, foo_id) VALUES (%(id)s, %(foo_id)s)'] [parameters: {'foo_id': 2, 'id': 1}] Change-Id: Ice7d7767842225951eaf48b71cedb2aabe5a84e4 (cherry picked from commit 1f3d509cab8c5d31f2ecd11561e1117d8c58316e)
* Updated from global requirements4.13.0OpenStack Proposal Bot2016-08-241-1/+1
| | | | Change-Id: I6b366e0918baf7b0ef79ffa1d7bfcbf7b74a2b4a
* Merge "Link enginefacade to test database provisioning"4.12.0Jenkins2016-08-171-27/+109
|\
| * Link enginefacade to test database provisioningMike Bayer2016-08-111-27/+109
| | | | | | | | | | | | | | | | | | | | | | This is part of a series which allows enginefacade to be at the base of database provisioning. Test fixtures are not impacted here, however the global "enginefacade" is used to generate database connections in provision.py Change-Id: I94753ca103851e3fd79c1c6c9773f57e311a0273
* | Updated from global requirementsOpenStack Proposal Bot2016-08-121-1/+1
|/ | | | Change-Id: I785f9994e616c0402370400e8a073a7f1a87161e
* Merge "Display full reason for backend not available"Jenkins2016-08-115-14/+176
|\
| * Display full reason for backend not availableMike Bayer2016-08-085-14/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds to the provisioning system the ability to preserve and re-display the full reason for a particular DB backend not available, and propagates this all the way through the skip() emitted by the OpportunisticTestCase and DbFixture. As part of the change, the database type requested is added to the messages themselves, which also appears in the messages emitted by the consuming is_backend_avail() function, which has tests that check for these explicit messages. New tests specific to the Backend object are added which are not dependent on is_backend_avail(); as this function is deprecated, we will be able to remove its tests at the same time as the function itself with no loss in coverage. Change-Id: I7c00e0770b02aa751e184edfecdec4306de6340c
* | Merge "Fix parameters of assertEqual are misplaced"Jenkins2016-08-1112-123/+122
|\ \
| * | Fix parameters of assertEqual are misplacedyan.haifeng2016-07-2012-123/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many assertEqual sentences don't follow assertEqual(expected, actual), These misplaces have 2 impacts: 1, giving confusing messages when some tests failed. 2, mislead other developers, new test modules may follow these wrong pattern. This patch fix all of them. Change-Id: Ia5155114c60f5e27cb00b8aba6de5cf32e046dd7 Closes-Bug: #1604213
* | | Merge "Add test helpers to enginefacade"Jenkins2016-08-112-2/+235
|\ \ \
| * | | Add test helpers to enginefacadeMike Bayer2016-08-032-2/+235
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | 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
* | | Merge "Updated from global requirements"Jenkins2016-08-101-1/+1
|\ \ \
| * | | Updated from global requirementsOpenStack Proposal Bot2016-08-081-1/+1
| | | | | | | | | | | | | | | | Change-Id: Ida04673890285af9c0b876c61a88693e6851932d
* | | | Merge "release notes: mention changes in wrap_db_retry()"Jenkins2016-08-101-0/+6
|\ \ \ \
| * | | | release notes: mention changes in wrap_db_retry()Roman Podoliaka2016-07-041-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Deprecate argument sqlite_db in method set_defaults"Jenkins2016-08-101-0/+4
|\ \ \ \ \
| * | | | | Deprecate argument sqlite_db in method set_defaultsChangBo Guo(gcb)2016-08-041-0/+4
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is follow up of commit 0a1bae9859079fb21a03716be947c5f1da6db0a2. Log warning when pass keyword argument sqlite_db. Related-Bug: #1329086 Change-Id: Ibed55dc9f28b7813bd96fb5e6f5138de0667591f
* | | | | Merge "Add logging_name to enginefacade config"Jenkins2016-08-102-0/+2
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Add logging_name to enginefacade configMike Bayer2016-08-032-0/+2
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Propagates logging_name through enginefacade.configure() to create_engine(), as will be used in the enginefacade-based test suite. Change-Id: Iabc03adbef9792e0be4d86c98851890846638efc
* | | | Updated from global requirements4.11.0OpenStack Proposal Bot2016-08-041-1/+1
|/ / / | | | | | | | | | Change-Id: I32efc2a5a5810f915193ab9a49b5ccad74772f0d
* | | Merge "Add a hook to process newly created engines"Jenkins2016-08-032-1/+24
|\ \ \
| * | | Add a hook to process newly created enginesAnn Kamyshnikova2016-07-312-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Capture DatabaseError for deadlock check4.10.0Kevin Benton2016-08-022-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Updated from global requirements"4.9.0Jenkins2016-07-291-1/+1
|\ \ \ \
| * | | | Updated from global requirementsOpenStack Proposal Bot2016-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I2ec090174889a9539229cfa3775621b39432db6c
* | | | | Merge "Consolidate pifpaf commands into variables"Jenkins2016-07-291-35/+11
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Consolidate pifpaf commands into variablesMike Bayer2016-07-191-35/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Memoize sys.exc_info() before attempting a savepoint rollback"Jenkins2016-07-293-5/+116
|\ \ \ \ \
| * | | | | Memoize sys.exc_info() before attempting a savepoint rollbackMike Bayer2016-07-273-5/+116
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | This presents a system of reporting the ultimate "cause" in the case that a MySQL failed SAVEPOINT rollback occurs. Change-Id: Iea834429a0b8398f076b10426525a5c17dbf3c85
* | | | | Updated from global requirementsOpenStack Proposal Bot2016-07-251-1/+1
|/ / / / | | | | | | | | | | | | Change-Id: Ie2e9b0b9507a85e899f68419d0686e03411be2e7
* | | | Updated from global requirementsOpenStack Proposal Bot2016-07-191-1/+1
|/ / / | | | | | | | | | Change-Id: Id85521335990acb47f65181724d6bdbf89d11c8b
* | | Merge "tox: add py35 envs for convenience"Jenkins2016-07-192-2/+14
|\ \ \
| * | | tox: add py35 envs for convenienceRoman Podoliaka2016-07-072-2/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Merge "Set max pool size default to 5"Jenkins2016-07-181-7/+7
|\ \ \ \
| * | | | Set max pool size default to 5Eric Brown2016-07-081-7/+7
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 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
* | | | Updated from global requirementsOpenStack Proposal Bot2016-07-171-1/+1
| | | | | | | | | | | | | | | | Change-Id: I465a02f70301d9927ed8e875b410b22ee3b3d144
* | | | Merge "Remove discover from setup.cfg"Jenkins2016-07-151-1/+0
|\ \ \ \
| * | | | Remove discover from setup.cfgThomas Bechtold2016-07-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's only needed for python < 2.7 which is not supported Change-Id: If364adc5d266557c68c85b5dcfde4c6439a773f7
* | | | | Fixed unit tests running on WindowsAlexandru Coman2016-07-141-1/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | Replaced all slashes in the paths with os.path.join, so that they are compatible with Windows and Linux. Change-Id: I65665a0f109d60b7a3e4187dd3c9409151d04ec7
* | | | Merge "Add dispose_pool() method to enginefacade context, factory"Jenkins2016-07-132-0/+57
|\ \ \ \
| * | | | Add dispose_pool() method to enginefacade context, factoryMike Bayer2016-07-112-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | Merge "Set a min and max on the connection_debug option"Jenkins2016-07-123-1/+9
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Set a min and max on the connection_debug optionEric Brown2016-07-093-1/+9
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Updated from global requirements4.8.0OpenStack Proposal Bot2016-07-091-2/+2
|/ / / | | | | | | | | | Change-Id: I3fa7441ceeecbb0af2f7b13046cdb1b339c6dc48
* | | Merge "exception: make message mandatory in DbMigrationError and deprecates it"Jenkins2016-07-087-22/+38
|\ \ \
| * | | exception: make message mandatory in DbMigrationError and deprecates itJulien Danjou2016-06-277-22/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An exception message with None as an error message is not really useful. Since DbMigrationError is also wrongly written with a lower case b whereas everything else has a major B, let's create a new correct class and use it. debtcollector is used to deprecate the old one, and inheritance makes sure the current code works. Change-Id: Id9a477aff38afd5b664b75a549ad561f4c24b6f0
* | | | Add support for LONGTEXT, MEDIUMTEXT to JsonEncodedTypeDavid Edery2016-07-072-0/+38
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | These types has the capacity of 2^32 and 2^24 bytes respectively in mysql and are needed in various use-cases. Change-Id: I498803eb0f294c0402666ee3911374a5d0399b82 Closes-Bug: #1599800 Related-Bug: https://bugs.launchpad.net/mistral/+bug/1438101 Related-Bug: https://bugs.launchpad.net/ironic/+bug/1596421
* | | Merge "Deprecate config option sqlite_db for removal"Jenkins2016-07-062-0/+10
|\ \ \
| * | | Deprecate config option sqlite_db for removalChangBo Guo(gcb)2016-07-062-0/+10
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | 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