Always return a sorted list of drivers for configs
glance.store entry point used in Glance for the store library is
resulting in generating random order in each run of the ``tox -e
genconfig`` command. This is because of the unsorted iterator returned
by the stevedore extension manager [1, 2].
This commit fixes that and returs a deterministic, sorted list of
drivers to generate the configs in Glance.
Example scenario is at change Iea2c538b37182191445cc5c1f8b2d9dceed06343
Closes-Bug: 1619487
[1] 22fa2b08e7/glance_store/backend.py (L135)
[2] http://docs.openstack.org/developer/stevedore/managers.html#stevedore.extension.ExtensionManager.__iter__
Co-Authored-By: Joshua Harlow <jxharlow@godaddy.com>
Change-Id: I3146b8597a5d89da49b84d6653edacc3067c2c71
This commit is contained in:
parent
22fa2b08e7
commit
b5833a8723
@ -132,7 +132,7 @@ def _list_opts():
|
|||||||
driver_opts = []
|
driver_opts = []
|
||||||
mgr = extension.ExtensionManager('glance_store.drivers')
|
mgr = extension.ExtensionManager('glance_store.drivers')
|
||||||
# NOTE(zhiyan): Handle available drivers entry_points provided
|
# NOTE(zhiyan): Handle available drivers entry_points provided
|
||||||
drivers = [ext.name for ext in mgr]
|
drivers = sorted([ext.name for ext in mgr])
|
||||||
handled_drivers = [] # Used to handle backwards-compatible entries
|
handled_drivers = [] # Used to handle backwards-compatible entries
|
||||||
for store_entry in drivers:
|
for store_entry in drivers:
|
||||||
driver_cls = _load_store(None, store_entry, False)
|
driver_cls = _load_store(None, store_entry, False)
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
prelude: >
|
||||||
|
Return list of store drivers in sorted order for
|
||||||
|
generating configs. More info in ``Upgrade Notes``
|
||||||
|
and ``Bug Fixes`` section.
|
||||||
|
upgrade:
|
||||||
|
- This version of glance_store will result in Glance
|
||||||
|
generating the configs in a sorted (deterministic)
|
||||||
|
order. So, preferably store releases on or after this
|
||||||
|
should be used for generating any new configs if the
|
||||||
|
mismatched ordering of the configs results in an issue
|
||||||
|
in your environment.
|
||||||
|
fixes:
|
||||||
|
- Bug 1619487 is fixed which was causing random order of
|
||||||
|
the generation of configs in Glance. See ``upgrade``
|
||||||
|
section for more details.
|
Loading…
Reference in New Issue
Block a user