From 0a2a10e3951dec74bd1fc16ab0d994d76361785b Mon Sep 17 00:00:00 2001 From: Darren Worrall Date: Tue, 15 Sep 2015 16:43:26 +0100 Subject: [PATCH] Fix json loading in sensu_check Fixes `AttributeError: 'str' object has no attribute 'read'` when the check path exists --- lib/ansible/modules/extras/monitoring/sensu_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/monitoring/sensu_check.py b/lib/ansible/modules/extras/monitoring/sensu_check.py index e1c51463aeb..c73fafdcd62 100644 --- a/lib/ansible/modules/extras/monitoring/sensu_check.py +++ b/lib/ansible/modules/extras/monitoring/sensu_check.py @@ -186,7 +186,7 @@ def sensu_check(module, path, name, state='present', backup=False): 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':