Merge pull request #983 from DazWorrall/bug/sensu_check_missing_file
Fix errors in sensu_check
This commit is contained in:
commit
984b7bd09d
1 changed files with 2 additions and 1 deletions
|
@ -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':
|
||||
|
|
Loading…
Add table
Reference in a new issue