Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added multiple paths in CHECKSD_OVERRIDE #3850

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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


Expand Down