Fix json loading in sensu_check
Fixes `AttributeError: 'str' object has no attribute 'read'` when the check path exists
This commit is contained in:
parent
b40a8af999
commit
0a2a10e395
1 changed files with 1 additions and 1 deletions
|
@ -186,7 +186,7 @@ def sensu_check(module, path, name, state='present', backup=False):
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
stream = open(path, 'r')
|
stream = open(path, 'r')
|
||||||
config = json.load(stream.read())
|
config = json.load(stream)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
if e.errno is 2: # File not found, non-fatal
|
if e.errno is 2: # File not found, non-fatal
|
||||||
if state == 'absent':
|
if state == 'absent':
|
||||||
|
|
Loading…
Reference in a new issue