Skip to content

Commit

Permalink
Merge pull request #37 from barryorourke/fix_returned_config_files
Browse files Browse the repository at this point in the history
fix config_files() so that it returns the correct values
  • Loading branch information
barryorourke authored Nov 23, 2017
2 parents 9bb13d6 + bffd620 commit 07b4dd6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)

# [Unreleased]
## Fixed
- Fixes `utils.config_files` so that it returns a list of files, rather than a list of `None`'s (@barryorourke)

# [0.4.2]
##Fixed
## Fixed
- Fixes `client_name` in `bail()` as it was using an incorrect path within `event` dict (@absolutejam)

# [0.4.1]
Expand Down
8 changes: 5 additions & 3 deletions sensu_plugin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ def config_files():
return sensu_config_files.split(':')
else:
files = ['/etc/sensu/config.json']
return [files.append('/etc/sensu/conf.d/{}'.format(filename))
for filename in os.listdir('/etc/sensu/conf.d')
if os.path.splitext(filename)[1] == '.json']
filenames = [f for f in os.listdir('/etc/sensu/conf.d')
if os.path.splitext(f)[1] == 'json']
for filename in filenames:
files.append('/etc/sensu/conf.d/{}'.format(filename))
return files


def get_settings():
Expand Down

0 comments on commit 07b4dd6

Please sign in to comment.