There is a lot of code in nova.db.sqlalchemy.utils which is also in oslo-incubator's openstack.common.db.sqlalchemy.utils module so this patch goes through and cleans up Nova. Notable differences: 1. modify_indexes was nova-only but no longer used after the migration compaction work, so it's just removed here. It also didn't really work for mysql in cases where the index name was too long so it could be table-specific and therefore unusable in some mysql cases. See commit 029ebab for history. 2. create_shadow_table was not in oslo-incubator and it's also not currently used in nova after the migration compaction, however, I leave it here in case future migrations in Nova need to use it. This patch does replace the usage of _get_not_supported_column in create_shadow_table to use the same method from oslo's DB utils. 3. DeleteFromSelect is still used within nova.db.api per commit b36826e so we could move it to oslo-incubator but this patch leaves it for now since it's only used in Nova. 4. InsertFromSelect was introduced with commit 2e403b2 but now there is a copy in oslo-incubator so we can remove our usage in nova. However, oslo doesn't have the unit test that nova does, so the unit test has been moved to oslo with change I457acf33. 5. Oslo has is_backend_avail and get_connect_string methods so use those in test_migrations.py while doing this update. Closes-Bug: #1280055 Change-Id: Iefa5b4311f1fe1a5da31cf527521c393f2face7c
5.4 KiB
5.4 KiB