mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 05:12:45 +00:00
Fix json loading in sensu_check
Fixes `AttributeError: 'str' object has no attribute 'read'` when the check path exists
This commit is contained in:
committed by
Matt Clay
parent
b40a8af999
commit
0a2a10e395
@@ -186,7 +186,7 @@ def sensu_check(module, path, name, state='present', backup=False):
|
||||
try:
|
||||
try:
|
||||
stream = open(path, 'r')
|
||||
config = json.load(stream.read())
|
||||
config = json.load(stream)
|
||||
except IOError, e:
|
||||
if e.errno is 2: # File not found, non-fatal
|
||||
if state == 'absent':
|
||||
|
||||
Reference in New Issue
Block a user