community.general/lib/ansible/module_utils
Toshio Kuratomi 6db6edfc4f YAML treats some unquoted strings as booleans. For instance, (#16961)
uri:
    follow_redirects: no

Will lead yaml to set follow_redirects=False.  This is problematic when
the module parameter is not a boolean value but a string.  For instance:

  follow_redirects = dict(required=False, default='safe', choices=['all', 'safe', 'none', 'yes', 'no']),

Our parameter validation code ends up getting follow_redirects="False"
instead of "no".  The 100% fix is for the user to quote their strings in
playbooks like:
  uri:
    follow_redirects: "no"

But we can fix quite a few common cases by trying to switch "False" back
into the string that it was specified as.  We only do this if there is
only one correct choices value that could have been specified.  In the
follow_redirects example, a value of "True" only maps back to "yes" and
a value of "False" only maps back to "no" so we can do this.  If choices
also contained "on" and "off" then we couldn't map back safely and would
need to force the module author to change the module to handle this
case.

Fixes parts of the following PRs:

* https://github.com/ansible/ansible-modules-core/pull/4220
* https://github.com/ansible/ansible-modules-extras/pull/2593
2016-08-05 06:49:34 -07:00
..
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
a10.py Ziploader 2016-04-05 11:06:17 -07:00
api.py Added basic auth argument spec to utils (#15585) 2016-04-25 14:55:39 -04:00
asa.py Module util, template action and doc fragment for Cisco ASA 2016-06-01 20:57:30 +02:00
azure_rm_common.py Fix the security rules name duplication of azure_rm_common. (#16897) 2016-08-04 10:43:30 -07:00
basic.py YAML treats some unquoted strings as booleans. For instance, (#16961) 2016-08-05 06:49:34 -07:00
cloudstack.py cloudstack: handle unicode API results in has_changed (#16601) 2016-07-06 20:27:31 +02:00
database.py just a few spelling error changes 2015-04-28 09:36:42 -04:00
docker_common.py Fix find_image() not matching on tag 2016-07-11 17:13:07 -04:00
ec2.py Merge pull request #14356 from mludvig/session_token 2016-06-22 18:51:09 -05:00
eos.py adds restconf transport option to ios shared module 2016-07-09 08:19:10 -04:00
f5.py Adds a general purpose Exception class for F5 modules (#15977) 2016-05-24 11:18:39 -04:00
facts.py refactored ethtool data to allow for other callers 2016-08-04 10:41:50 -04:00
gcdns.py Fix import of gce/gcdns without a libcloud module 2016-07-29 13:34:09 -04:00
gce.py Fix import of gce/gcdns without a libcloud module 2016-07-29 13:34:09 -04:00
gcp.py Refactored gce util module to support other GCP services (#15924) 2016-07-28 12:54:39 -04:00
ios.py add new features to ios shared module 2016-07-11 05:57:15 -07:00
iosxr.py Net mod ios (#16426) 2016-07-07 13:46:33 -04:00
ismount.py fix typo 2016-02-08 19:10:04 +01:00
junos.py Added and-quit to all commit statements. (#16411) 2016-07-01 12:11:05 -04:00
known_hosts.py Add support ssh configs from /etc/openssh. 2016-01-14 13:01:49 +03:00
mysql.py enable mysql connection via unix socket 2016-04-12 14:16:18 +02:00
netcfg.py minor update to the default comment tokens in netcfg 2016-07-15 16:13:41 -04:00
netcmd.py adds new method to return specific response from command to netcmd 2016-07-04 22:20:51 -04:00
network.py adds restconf transport option to ios shared module 2016-07-09 08:19:10 -04:00
nxos.py fixes issue with ssh keyfile and nxos authentication 2016-06-07 21:01:34 -04:00
openstack.py Set type for OpenStack 'verify' param 2016-03-11 08:07:30 -05:00
openswitch.py openswitch.py: Fix the OpenSwitch REST authentication 2016-05-18 00:17:32 -07:00
powershell.ps1 moved pending reboot to powershell.ps1 2016-06-06 23:18:51 +02:00
pycompat24.py Rename pycompat to pycompat24 2016-05-18 06:18:01 -07:00
rax.py Port rax.py to python3 compatible syntax (#15875) 2016-05-16 17:30:25 -07:00
redhat.py Remove some more unused stdlib deps. 2015-11-03 09:53:18 -08:00
service.py Remove some more unused stdlib deps. 2015-11-03 09:53:18 -08:00
shell.py Find places where ziploader is used and change them to ansiballz so that people aren't confused when they google for information.information (#16715) 2016-07-21 10:58:24 -07:00
six.py Some Python-3 module_utils support 2016-05-14 07:51:13 -07:00
splitter.py Insert newlines correctly when splitting literal blocks 2014-10-09 16:45:08 -05:00
urls.py Port urls.py to python3 and other byte vs text fixes (#16124) 2016-06-04 16:19:57 -07:00
vca.py Port the module snippet to python3 (#15870) 2016-05-16 08:04:43 -04:00
vmware.py Port the module snippet to python3 (#15870) 2016-05-16 08:04:43 -04:00
vyos.py adds new function to check config for unsupported commands 2016-07-15 16:12:12 -04:00