Merge pull request #983 from DazWorrall/bug/sensu_check_missing_file

Fix errors in sensu_check
This commit is contained in:
James Cammarata 2015-09-16 14:00:02 -04:00
commit 984b7bd09d

View file

@ -182,10 +182,11 @@ def sensu_check(module, path, name, state='present', backup=False):
except ImportError:
import simplejson as json
stream = None
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':