Skip to content

Commit

Permalink
Allow custom pythonpaths in checks.d, fixes #227
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbranagan committed Oct 25, 2012
1 parent 71e376b commit d3b281c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,13 @@ def load_check_directory(agentConfig):
check_class = check_class(check_name, init_config=init_config,
agentConfig=agentConfig)

# Add custom pythonpath(s) if available
if 'pythonpath' in check_config:
pythonpath = check_config['pythonpath']
if not isinstance(pythonpath, list):
pythonpath = [pythonpath]
sys.path.extend(pythonpath)

log.debug('Loaded check.d/%s.py' % check_name)
checks.append({
'name': check_name,
Expand Down

0 comments on commit d3b281c

Please sign in to comment.