1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[cloud] rds module: handle parameters that are False, but also not the default value. Fixes #20370 (#20646)

Boolean options that default as `None` but are set to `False` by the user were ignored on update. This change checks to distinguish None & False so that options like multi_az can be turned off during an update. 

* Modifying how optional parameters are handled in rds.py. Fixes #20370

Allowing options to be set to false/no. Previously ignored unless set to true/yes.

Added a conditional for invalid parameters since the default is false instead of null for some options (e.g. force_failover, apply_immediately, upgrade).

* Making requested revision.
This commit is contained in:
s-hertel 2017-02-02 09:49:19 -05:00 committed by Ryan Brown
parent c33812450e
commit 0ed1e6a1f3

View file

@ -1001,11 +1001,14 @@ def validate_parameters(required_vars, valid_vars, module):
params = {}
for (k, v) in optional_params.items():
if module.params.get(k) and k not in required_vars:
if module.params.get(k) is not None and k not in required_vars:
if k in valid_vars:
params[v] = module.params[k]
else:
module.fail_json(msg="Parameter %s is not valid for %s command" % (k, command))
if module.params.get(k) == False:
pass
else:
module.fail_json(msg="Parameter %s is not valid for %s command" % (k, command))
if module.params.get('security_groups'):
params[sec_group] = module.params.get('security_groups').split(',')