Duplicate imports of the same class + super() are not playing nicely
together, and our unit test base classes cause some dups in the extension
search path, breaking the service repos. This was not noticed earlier
in the extension moving process, because the temporary move code had a crude
mechanism to prevent the loading of same named extensions.
Change-Id: I0fbb2dbc01c67bb47a79f630ad352d1d92b6bb91
Partially-Implements: blueprint services-split
# under the License.
import abc
+import collections
import imp
import itertools
import os
if cfg.CONF.api_extensions_path:
paths.append(cfg.CONF.api_extensions_path)
+ # If the path has dups in it, from discovery + conf file, the duplicate
+ # import of the same module and super() do not play nicely, so weed
+ # out the duplicates, preserving search order.
+
+ z = collections.OrderedDict()
+ for x in paths:
+ z[x] = 1
+ paths = z.keys()
+
LOG.debug("get_extension_paths = %s", paths)
path = ':'.join(paths)