mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
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"
This commit is contained in:
parent
961af6d9e2
commit
f018851303
1 changed files with 2 additions and 2 deletions
|
@ -112,7 +112,7 @@ def sensu_subscription(module, path, name, state='present', backup=False):
|
||||||
if 'subscriptions' not in config['client']:
|
if 'subscriptions' not in config['client']:
|
||||||
if state == 'absent':
|
if state == 'absent':
|
||||||
reasons.append('`client.subscriptions\' did not exist and state is `absent\'')
|
reasons.append('`client.subscriptions\' did not exist and state is `absent\'')
|
||||||
return changed
|
return changed, reasons
|
||||||
config['client']['subscriptions'] = []
|
config['client']['subscriptions'] = []
|
||||||
changed = True
|
changed = True
|
||||||
reasons.append('`client.subscriptions\' did not exist')
|
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 name not in config['client']['subscriptions']:
|
||||||
if state == 'absent':
|
if state == 'absent':
|
||||||
reasons.append('channel subscription was absent')
|
reasons.append('channel subscription was absent')
|
||||||
return changed
|
return changed, reasons
|
||||||
config['client']['subscriptions'].append(name)
|
config['client']['subscriptions'].append(name)
|
||||||
changed = True
|
changed = True
|
||||||
reasons.append('channel subscription was absent and state is `present\'')
|
reasons.append('channel subscription was absent and state is `present\'')
|
||||||
|
|
Loading…
Reference in a new issue