1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/lib/ansible
Adrian Likins dd0189839e Fix bug (#18355) where encrypted inventories fail 18355 (#18373)
* Fix bug (#18355) where encrypted inventories fail

This is first part of fix for #18355
* Make DataLoader._get_file_contents return bytes

The issue #18355 is caused by a change to inventory to
stop using _get_file_contents so that it can handle text
encoding itself to better protect against harmless text
encoding errors in ini files (invalid unicode text in
comment fields).

So this makes _get_file_contents return bytes so it and other
callers can handle the to_text().

The data returned by _get_file_contents() is now a bytes object
instead of a text object. The callers of _get_file_contents() have
been updated to call to_text() themselves on the results.

Previously, the ini parser attempted to work around
ini files that potentially include non-vailid unicode
in comment lines. To do this, it stopped using
DataLoader._get_file_contents() which does the decryption of
files if vault encrypted. It didn't use that because _get_file_contents
previously did to_text() on the read data itself.

_get_file_contents() returns a bytestring now, so ini.py
can call it and still special case ini file comments when
converting to_text(). That also means encrypted inventory files
are decrypted first.

Fixes #18355
2016-11-07 10:07:26 -05:00
..
cli Python 3 fixes for ansible-doc. 2016-11-03 16:09:24 -07:00
compat Move py34 mock_open compat to compat/test/mock (#17157) 2016-08-19 18:11:24 -04:00
config Making the switch to v2 2015-05-03 21:47:26 -05:00
errors Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
executor Change v2_playbook_on_start logic to positively detect legacy plugins 2016-10-28 10:05:58 -07:00
galaxy Cast input role version to string before comparing to available versions (#18269) 2016-10-31 21:07:38 -04:00
inventory Fix bug (#18355) where encrypted inventories fail 18355 (#18373) 2016-11-07 10:07:26 -05:00
module_utils On python 3.5, sys.subversion have been removed 2016-11-07 09:24:06 -05:00
modules Update submodule refs 2016-11-03 22:08:55 -04:00
parsing Fix bug (#18355) where encrypted inventories fail 18355 (#18373) 2016-11-07 10:07:26 -05:00
playbook Correctly reassign implicit block parents when an include is involved 2016-11-03 11:57:23 -05:00
plugins Fix bug (#18355) where encrypted inventories fail 18355 (#18373) 2016-11-07 10:07:26 -05:00
template Remove unnecessary warnings (#18121) 2016-10-20 22:49:49 -04:00
utils added docs for new arg 2016-11-04 17:11:21 -04:00
vars Correct delegated_host_name check 2016-10-11 11:15:53 -07:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py ANSIBLE_SSH_CONTROL_PATH_DIR option added (#18342) 2016-11-03 15:19:59 -07:00
release.py Bumping devel version to 2.3.0 2016-10-03 11:46:31 -05:00
test-requirements.txt Making the switch to v2 2015-05-03 21:47:26 -05:00