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
This commit is contained in:
Brad Hall
2011-09-30 01:13:24 -07:00
parent aab44f3615
commit 14069f9e0a
2 changed files with 8 additions and 3 deletions

View File

@@ -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]

View File

@@ -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):