From: Brad Hall Date: Fri, 30 Sep 2011 08:13:24 +0000 (-0700) Subject: Add the ability to specify multiple extension directories X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=14069f9e0abb31b784050074165b3eeb354ab4ea;p=openstack-build%2Fneutron-build.git Add the ability to specify multiple extension directories This allows for a colon-separated list of extension directories that will be loaded at startup. Change-Id: Ie7acb24a929b1782be3e916113a90ede238dee40 --- diff --git a/etc/quantum.conf b/etc/quantum.conf index 42347c763..3b2125889 100644 --- a/etc/quantum.conf +++ b/etc/quantum.conf @@ -11,7 +11,9 @@ bind_host = 0.0.0.0 # Port the bind the API server to bind_port = 9696 -# Path to the extensions +# Path to the extensions. Note that this can be a colon-separated list of +# paths. For example: +# api_extensions_path = extensions:/path/to/more/extensions:/even/more/extensions api_extensions_path = extensions [composite:quantum] diff --git a/quantum/common/extensions.py b/quantum/common/extensions.py index cfe6bc786..380572c0c 100644 --- a/quantum/common/extensions.py +++ b/quantum/common/extensions.py @@ -419,8 +419,11 @@ class ExtensionManager(object): extension implementation. """ - if os.path.exists(self.path): - self._load_all_extensions_from_path(self.path) + for path in self.path.split(':'): + if os.path.exists(path): + self._load_all_extensions_from_path(path) + else: + LOG.error("Extension path \"%s\" doesn't exist!" % path) def _load_all_extensions_from_path(self, path): for f in os.listdir(path):