From ab493bc8da773dd0c45b88bfe0f37e339f288061 Mon Sep 17 00:00:00 2001 From: Reza Farrahi Date: Thu, 21 Jun 2018 13:01:39 -0400 Subject: [PATCH] issues #3758 Enabling multiple paths in CHECKSD_OVERRIDE --- config.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/config.py b/config.py index f501fc5ef3..4853e5e004 100644 --- a/config.py +++ b/config.py @@ -218,8 +218,13 @@ def _confd_path(directory): def _checksd_path(directory): - path_override = os.environ.get('CHECKSD_OVERRIDE') - if path_override and os.path.exists(path_override): + checks_override_env = os.environ.get('CHECKSD_OVERRIDE') + checks_override_env_split = checks_override_env.split(':') + path_override=[] + for checks_override_env_individual_path in checks_override_env_split: + if checks_override_env_individual_path and os.path.exists(checks_override_env_individual_path): + path_override.append(checks_override_env_individual_path) + if path_override: return path_override # this is deprecated in testing on versions after SDK (5.12.0) @@ -1016,7 +1021,8 @@ def get_checks_places(osname, agentConfig): # agent-bundled integrations if checksd_path: - places.append(lambda name: (os.path.join(checksd_path, '%s.py' % name), None)) + for checksd_path_individual in checksd_path: + places.append(lambda name: (os.path.join(checksd_path_individual, '%s.py' % name), None)) return places