Fix json loading in sensu_check

Fixes `AttributeError: 'str' object has no attribute 'read'` when the
check path exists
reviewable/pr18780/r1
Darren Worrall 9 years ago
parent 4ead053031
commit b0926125c2

@ -186,7 +186,7 @@ def sensu_check(module, path, name, state='present', backup=False):
try: try:
try: try:
stream = open(path, 'r') stream = open(path, 'r')
config = json.load(stream.read()) config = json.load(stream)
except IOError, e: except IOError, e:
if e.errno is 2: # File not found, non-fatal if e.errno is 2: # File not found, non-fatal
if state == 'absent': if state == 'absent':

Loading…
Cancel
Save