Skip to content

Commit

Permalink
better checks.d folder lookup on windows, fixes #261
Browse files Browse the repository at this point in the history
  • Loading branch information
conorbranagan committed Nov 15, 2012
1 parent e914764 commit 2493bf3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ def _windows_confd_path():
raise PathNotFound(path)

def _windows_checksd_path():
path = os.path.join(os.environ['PROGRAMFILES'], 'Datadog', 'Datadog Agent',
'checks.d')
if hasattr(sys, 'frozen'):
# we're frozen - from py2exe
prog_path = os.path.dirname(sys.executable)
path = os.path.join(prog_path, 'Datadog', 'Datadog Agent', 'checks.d')
else:
cur_path = os.path.dirname(__file__)
path = os.path.join(cur_path, 'checks.d')
if os.path.exists(path):
return path
raise PathNotFound(path)
Expand Down

0 comments on commit 2493bf3

Please sign in to comment.