community.general/lib/ansible
Michael Noseworthy bb5d8fb476 Fix unicode handling in fixup_perms2 errorhandling (#18565)
The _fixup_perms2 method checks to see if the user that is being sudo'd
is an unprivileged user or root. If it is an unprivileged user, some
checks are done to see if becoming this user would lock the ssh user out
of temp files, among other things. If this check fails, an error prints
telling the user to check the documentation for becoming an unprivileged
user.

On some systems, the stderr prints out the unprivileged user the ssh
user was trying to become contained in smartquotes. These quotes aren't
in the ASCII range, and so when we're trying to call `str.format()` to
combine the stderr message with the error text we get a
UnicodeEncodeError as python can't coerce the smartquotes using the
system default encoding. By calling `to_native()` on the error message
we can ensure that the error message is a native string for the
`Exception` handling, as `Exception` messages need to be native strings
to avoid errors (byte strings in python2, and text strings in python3)

Fixes: #18444
2016-11-22 11:19:47 -08: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 Add error info if tabs are found in the yaml (#18343) 2016-11-08 11:43:08 -05:00
executor Adding a persistent connection utility 2016-11-21 12:35:27 -06:00
galaxy Cast input role version to string before comparing to available versions (#18269) 2016-10-31 21:07:38 -04:00
inventory Properly sort groups by name as well as depth when getting vars 2016-11-18 22:57:52 -06:00
module_utils Fix for whitespace padding on JSON responses 2016-11-22 11:06:57 -05:00
modules Update submodule ref for mount fixes 2016-11-19 15:30:53 -08:00
parsing Fix 'ansible-vault edit' crash on changed nonascii 2016-11-16 15:14:07 -05:00
playbook Rework how the Conditional class deals with undefined vars 2016-11-22 08:29:58 -06:00
plugins Fix unicode handling in fixup_perms2 errorhandling (#18565) 2016-11-22 11:19:47 -08:00
template always template when called from template (#18490) 2016-11-15 15:16:46 -05:00
utils Network docs fragments: fix copy paste errors (#18564) 2016-11-21 11:36:32 +00:00
vars Rework how the Conditional class deals with undefined vars 2016-11-22 08:29:58 -06:00
__init__.py Fix ziploader for the cornercase of ansible invoking ansible. 2016-04-29 08:47:49 -07:00
constants.py Adding a persistent connection utility 2016-11-21 12:35:27 -06: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