community.general/lib/ansible/plugins
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
..
action Fix unicode handling in fixup_perms2 errorhandling (#18565) 2016-11-22 11:19:47 -08:00
cache Remove direct calls to print and cleanup imports 2016-11-07 17:12:36 -05:00
callback disable 'dense' callback in py26 2016-11-18 11:41:56 -05:00
connection Adding a persistent connection utility 2016-11-21 12:35:27 -06:00
filter random filter: added optional 'seed' parameter 2016-11-17 15:02:06 -08:00
lookup Replaced iterkeys with 'for key in dict' for #18507 (#18538) 2016-11-21 07:18:52 -08:00
shell Mcsalgado's change to use shlex.quote instead of pipes.quote (#18534) 2016-11-17 13:18:29 -08:00
strategy Cache dynamically included blocks for later lookup via uuid 2016-11-21 13:02:24 -06:00
test restored 'results' filters 2016-10-13 13:21:40 -04:00
vars Making the switch to v2 2015-05-03 21:47:26 -05:00
__init__.py Filter out internal magic and connection variables from facts returns 2016-10-24 17:27:43 -05:00