summaryrefslogtreecommitdiffstats
path: root/core/loader/loader_servant.py
diff options
context:
space:
mode:
authorMartin Klozik <martinx.klozik@intel.com>2015-10-19 04:36:45 +0100
committerMaryam Tahhan <maryam.tahhan@intel.com>2015-10-20 14:27:19 +0000
commitba33eda4f9ad307178668c2634de6bec1c53a0d3 (patch)
treec16b04654e20572dedc0e7afa7dbcb7db25a7ab2 /core/loader/loader_servant.py
parent0bb85c9c85b7aeb74761c6a565e554674a7661c1 (diff)
exclude files from the search in the Loader
New configuration parameter EXCLUDE_MODULES defines module names, which won't be automatically loaded by LoaderServant. It can be used to exclude obsolete or abstract modules. Change-Id: If98b50b1505465bcedcf28fe63421c73a4fe160a JIRA: VSPERF-118 Signed-off-by: Martin Klozik <martinx.klozik@intel.com> Reviewed-by: Billy O Mahony <billy.o.mahony@intel.com> Reviewed-by: Maryam Tahhan <maryam.tahhan@intel.com> Reviewed-by: Fatih Degirmenci <fatih.degirmenci@ericsson.com> Reviewed-by: Gene Snider <eugene.snider@huawei.com> Reviewed-by: Al Morton <acmorton@att.com> Reviewed-by: Tv Rao <tv.rao@freescale.com> Reviewed-by: Brian Castelli <brian.castelli@spirent.com>
Diffstat (limited to 'core/loader/loader_servant.py')
-rw-r--r--core/loader/loader_servant.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/loader/loader_servant.py b/core/loader/loader_servant.py
index 3b729c23..dc6353ff 100644
--- a/core/loader/loader_servant.py
+++ b/core/loader/loader_servant.py
@@ -26,6 +26,7 @@ from os import sys
import imp
import fnmatch
import logging
+from conf import settings
class LoaderServant(object):
@@ -167,6 +168,10 @@ class LoaderServant(object):
for filename in fnmatch.filter(filenames, '[!.]*.py'):
modname = os.path.splitext(os.path.basename(filename))[0]
+ # skip module load if it is excluded by configuration
+ if modname in settings.getValue('EXCLUDE_MODULES'):
+ continue
+
try:
if modname in sys.modules:
mod = sys.modules[modname]