From f01885130357ea5c54ef62d3f4d5df3e3027c204 Mon Sep 17 00:00:00 2001 From: Anders Ingemann Date: Mon, 10 Jul 2017 21:07:25 +0200 Subject: [PATCH] sensu_subscription: Fix return type for 2 cases (#26546) state=absent would cause errors in 2 cases resulting in the error: "TypeError: 'bool' object is not iterable" --- lib/ansible/modules/monitoring/sensu_subscription.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/monitoring/sensu_subscription.py b/lib/ansible/modules/monitoring/sensu_subscription.py index aba52f9cd5..b8e006b8b3 100644 --- a/lib/ansible/modules/monitoring/sensu_subscription.py +++ b/lib/ansible/modules/monitoring/sensu_subscription.py @@ -112,7 +112,7 @@ def sensu_subscription(module, path, name, state='present', backup=False): if 'subscriptions' not in config['client']: if state == 'absent': reasons.append('`client.subscriptions\' did not exist and state is `absent\'') - return changed + return changed, reasons config['client']['subscriptions'] = [] changed = True reasons.append('`client.subscriptions\' did not exist') @@ -120,7 +120,7 @@ def sensu_subscription(module, path, name, state='present', backup=False): if name not in config['client']['subscriptions']: if state == 'absent': reasons.append('channel subscription was absent') - return changed + return changed, reasons config['client']['subscriptions'].append(name) changed = True reasons.append('channel subscription was absent and state is `present\'')