1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Initialise stream variable

Fixes `UnboundLocalError: local variable 'stream' referenced before
assignment` when the check path doesnt exist
This commit is contained in:
Darren Worrall 2015-09-15 16:40:01 +01:00 committed by Matt Clay
parent d3b680e1c9
commit b40a8af999

View file

@ -182,6 +182,7 @@ def sensu_check(module, path, name, state='present', backup=False):
except ImportError:
import simplejson as json
stream = None
try:
try:
stream = open(path, 'r')