Skip to content

Commit bffd620

Browse files
committed
fix config_files() so that it returns the correct values
1 parent 9bb13d6 commit bffd620

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ This project adheres to [Semantic Versioning](http://semver.org/).
44
This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
55

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

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

1214
# [0.4.1]

sensu_plugin/utils.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ def config_files():
2020
return sensu_config_files.split(':')
2121
else:
2222
files = ['/etc/sensu/config.json']
23-
return [files.append('/etc/sensu/conf.d/{}'.format(filename))
24-
for filename in os.listdir('/etc/sensu/conf.d')
25-
if os.path.splitext(filename)[1] == '.json']
23+
filenames = [f for f in os.listdir('/etc/sensu/conf.d')
24+
if os.path.splitext(f)[1] == 'json']
25+
for filename in filenames:
26+
files.append('/etc/sensu/conf.d/{}'.format(filename))
27+
return files
2628

2729

2830
def get_settings():

0 commit comments

Comments
 (0)