Allow value to be bool where 'yes'/'no' are in choices (#2593)

* Changed type of 'details' argument to bool on ecs_service_facts module.

* Changed type of 'autostart' argument to bool on virt_* modules.

* Changed types of 'autoconnect' and 'stp' argument to bool on nmcli module.
('create_connection_bridge(self)' and 'modify_connection_bridge(self)' are not implemented yet?)

* Added conversion of 'value' argument when 'vtype' is boolean on debconf module.
This commit is contained in:
Shinichi TAMURA 2016-08-17 23:32:49 +09:00 committed by Matt Clay
parent b54d352a69
commit a3860ecf1e
5 changed files with 30 additions and 21 deletions

View file

@ -644,16 +644,16 @@ def core(module):
else:
module.fail_json(msg="Command %s not recognized" % basecmd)
if autostart:
if autostart is not None:
if not name:
module.fail_json(msg = "state change requires a specified name")
res['changed'] = False
if autostart == 'yes':
if autostart:
if not v.get_autostart(name):
res['changed'] = True
res['msg'] = v.set_autostart(name, True)
elif autostart == 'no':
else:
if v.get_autostart(name):
res['changed'] = True
res['msg'] = v.set_autostart(name, False)
@ -672,7 +672,7 @@ def main():
command = dict(choices=ALL_COMMANDS),
uri = dict(default='qemu:///system'),
xml = dict(),
autostart = dict(choices=['yes', 'no']),
autostart = dict(type='bool'),
mode = dict(choices=ALL_MODES),
),
supports_check_mode = True