placement/placement/tests/functional
Chris Dent 0c9b38a88e Add register_opts param to PlacementFixture
There are scenarios where it is useful to create a ConfigOpts
and register_opts on it before ever calling the PlacementFixture.
If that is done we don't want to re-register the opts within
the fixture as this can lead to errors (especially when CLI
opts are involved).

The scenario that discovered this problem is in nova in a regression
test [1] where a ConfigOpts is created and registered, the placement
DatabaseFixture is started and then that same config is used in
multiple instances of the PlacementFixture, each of which again
register_opts(). Until commit b647919666
this wasn't a problem because the default opts in placement did
not include any CLI options. Adding logging opts brought some in.

This change adds a flag to the constructor for PlacementFixture,
register_opts, defaulting to True, which lets the caller say
no, I don't want do register.

The version of this change on master also reverted the revert of
b647919666 to perform
oslo_log.log.register_opts() from a central location. That doesn't
happen here because that revert (which was an interim quick fix) was
not backported to stable/stein.

[1] test_bug_1679750.TestLocalDeleteAllocations.test_local_delete_removes_allocations_after_compute_restart

Change-Id: I360a306b5d05ada75274733038b73ec2f2bdc4d4
Needed-By: I042e41ac8c41c0e5f0389904eb548e0e97d54c60
Related-Bug: #1821092
(cherry picked from commit f7f5231677)
2019-03-21 13:27:40 +00:00
..
cmd Add upgrade status check for missing root ids 2019-01-25 05:53:53 +00:00
db Merge "Refactor tests of _get_trees_matching_all()" 2019-03-19 14:53:30 +00:00
fixtures Add register_opts param to PlacementFixture 2019-03-21 13:27:40 +00:00
gabbits Merge "Fix a bad granular gabbi test" 2019-02-26 17:35:59 +00:00
__init__.py Empty __init__.py files that should be empty 2018-09-04 10:31:26 -05:00
base.py Stop using global oslo_config 2018-11-30 14:51:23 +00:00
test_api.py Rename files to remove 'placement' 2018-09-07 20:10:06 +00:00
test_direct.py Stop using global oslo_config 2018-11-30 14:51:23 +00:00
test_verify_policy.py Stop using global oslo_config 2018-11-30 14:51:23 +00:00