When using a cluster of load-balanced Neutron Servers,
the order of extension files being loaded may differ
from one server to another. This is usually harmless,
but it is better to force the list to be loaded in the
same way across the entire cluster, just in case
something funky is going on.
Partial-bug: #
1285999
Change-Id: Ib0bfd24fc52b6cd9f90c350d3af496f04a90f50a
LOG.error(_("Extension path '%s' doesn't exist!"), path)
def _load_all_extensions_from_path(self, path):
- for f in os.listdir(path):
+ # Sorting the extension list makes the order in which they
+ # are loaded predictable across a cluster of load-balanced
+ # Neutron Servers
+ for f in sorted(os.listdir(path)):
try:
LOG.info(_('Loading extension file: %s'), f)
mod_name, file_ext = os.path.splitext(os.path.split(f)[-1])