ansible/lib/ansible
Toshio Kuratomi 0000b76a0a 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
(cherry picked from commit 6db6edfc4f)
2016-08-05 06:51:18 -07:00
..
cli correctly set become value in console 2016-07-07 10:43:19 -04:00
compat Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 2015-10-16 08:21:28 -07:00
config
errors Add options to make includes 'static' 2016-03-24 10:12:51 -04:00
executor fix for unspecified retries on until + test (#16963) 2016-08-04 19:31:49 -04:00
galaxy moved validate info from vvv to debug 2016-05-27 09:44:42 -04:00
inventory Implicit localhost ondemand (#16900) 2016-08-02 10:39:37 -04:00
module_utils YAML treats some unquoted strings as booleans. For instance, (#16961) 2016-08-05 06:51:18 -07:00
modules New release v2.1.1.0-1 2016-07-28 10:32:34 -07:00
new_inventory fix some warning of undefined name. 2015-10-09 12:43:42 +08:00
parsing Only show the traceback for importing cryptography when in Ansible Debug. (#16795) 2016-07-22 05:41:45 -07:00
playbook Force remote_user to be the currently user for connection=local 2016-07-06 23:10:47 -05:00
plugins Fix for issue @synchronize doesn't substitute variables properly #16347 (#16349) 2016-08-04 11:30:43 -07:00
template allow spaces before the filter string (#16312) 2016-06-15 14:17:56 -04:00
utils * Fix race in creating temp directories pre-fork (#16965) 2016-08-04 16:43:22 -07:00
vars Implicit localhost ondemand (#16900) 2016-08-02 10:39:37 -04:00
__init__.py Removing __version__ from __init__.py since it belongs in release.py 2016-06-04 11:00:08 -05:00
constants.py * Fix race in creating temp directories pre-fork (#16965) 2016-08-04 16:43:22 -07:00
release.py New release v2.1.1.0-0.1.rc1 2016-06-17 14:33:25 -05:00
test-requirements.txt