]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Add the ability to specify multiple extension directories
authorBrad Hall <brad@nicira.com>
Fri, 30 Sep 2011 08:13:24 +0000 (01:13 -0700)
committerBrad Hall <brad@nicira.com>
Sun, 2 Oct 2011 22:46:29 +0000 (15:46 -0700)
This allows for a colon-separated list of extension directories that will be
loaded at startup.

Change-Id: Ie7acb24a929b1782be3e916113a90ede238dee40

etc/quantum.conf
quantum/common/extensions.py

index 42347c76388c19d12b9fe2135cd85c080e7f1e95..3b212588964a9f88ce4ff208946e8be5070b7fc8 100644 (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]
index cfe6bc786a9b343ddb473dd27fc5fff5af985e51..380572c0c2f7c16c4f3bcfc5b9b70f475010c846 100644 (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):