Initialise stream
variable
Fixes `UnboundLocalError: local variable 'stream' referenced before assignment` when the check path doesnt exist
This commit is contained in:
parent
d3b680e1c9
commit
b40a8af999
1 changed files with 1 additions and 0 deletions
|
@ -182,6 +182,7 @@ def sensu_check(module, path, name, state='present', backup=False):
|
||||||
except ImportError:
|
except ImportError:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
|
||||||
|
stream = None
|
||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
stream = open(path, 'r')
|
stream = open(path, 'r')
|
||||||
|
|
Loading…
Reference in a new issue