aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--conf/00_common.conf10
-rw-r--r--core/loader/loader_servant.py5
2 files changed, 15 insertions, 0 deletions
diff --git a/conf/00_common.conf b/conf/00_common.conf
index ef1c6280..51dceb32 100644
--- a/conf/00_common.conf
+++ b/conf/00_common.conf
@@ -59,3 +59,13 @@ VERBOSITY = 'debug'
# from anywhere in the test framework so be careful with naming
# conventions
TEST_PARAMS = {}
+
+# ############################
+# Modules
+# ############################
+
+# following modules will be excluded from automatic load by LoaderServant
+# it can be used to suppress automatic load of obsoleted or abstract modules
+# Example:
+# EXCLUDE_MODULES = ['ovs_vanilla', 'qemu_virtio_net', 'pidstat']
+EXCLUDE_MODULES = []
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]