From 0abf9011051187c16f4418ce27462a9e1be35f1f Mon Sep 17 00:00:00 2001 From: Doug Wiegley Date: Wed, 4 Feb 2015 21:33:35 -0600 Subject: [PATCH] Fix breakage in all service repo unit tests, due to duplicate imports of exts 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 --- neutron/api/extensions.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/neutron/api/extensions.py b/neutron/api/extensions.py index dd0e71a8a..cf273ddca 100644 --- a/neutron/api/extensions.py +++ b/neutron/api/extensions.py @@ -15,6 +15,7 @@ # under the License. import abc +import collections import imp import itertools import os @@ -676,6 +677,15 @@ def get_extensions_path(): 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) -- 2.45.2