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/plugins/action
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
..
__init__.py Fix unicode handling in fixup_perms2 errorhandling (#18565) 2016-11-22 11:19:47 -08:00
add_host.py Allow groups to be specified using YAML list syntax for add_host 2016-06-18 07:47:10 -05:00
asa_config.py fix up asa shared module 2016-09-04 08:31:40 -04:00
asa_template.py Module util, template action and doc fragment for Cisco ASA 2016-06-01 20:57:30 +02:00
assemble.py Remove unicode escape (#17866) 2016-10-02 22:12:51 -07:00
assert.py Implements verbose always to assert action plugin module (#17654) 2016-09-20 10:52:21 -05:00
async.py Mcsalgado's change to use shlex.quote instead of pipes.quote (#18534) 2016-11-17 13:18:29 -08:00
copy.py copy: Use the local file's mode for the argument if not explicitly given. (#17780) 2016-10-24 23:57:50 -04:00
debug.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
dellos6_config.py Renamed the Modules from dnos* -> dellos*, updated copyright, removed… (#17617) 2016-09-16 22:45:08 +01:00
dellos9_config.py Renamed the Modules from dnos* -> dellos*, updated copyright, removed… (#17617) 2016-09-16 22:45:08 +01:00
dellos10_config.py Renamed the Modules from dnos* -> dellos*, updated copyright, removed… (#17617) 2016-09-16 22:45:08 +01:00
eos_config.py updates eos shared module 2016-08-22 20:26:16 -04:00
eos_template.py initial add of action plugin eos_template 2016-02-01 11:51:52 -05:00
fail.py Two fixes to action plugins 2015-10-22 16:07:26 -07:00
fetch.py simplified the code by removing repeats 2016-10-26 20:49:55 -04:00
group_by.py Do not set 'changed' to True when using group_by 2016-01-04 17:46:40 +01:00
include_vars.py Return failed instead of raising an error when an include_vars file is missing 2016-11-18 09:28:44 -06:00
ios_config.py adds action plugin for working with network configuration files 2016-07-11 06:12:31 -07:00
ios_template.py initial add of action plugin ios_template 2016-02-01 11:54:02 -05:00
iosxr_config.py updates iosxr shared module 2016-08-24 11:03:01 -04:00
iosxr_template.py adds new action plugin iosxr_template 2016-02-12 17:08:21 -05:00
junos_config.py roll up of updates to junos shared module 2016-09-04 08:37:33 -04:00
junos_template.py updates action plugin junos_template to guess file format 2016-04-24 11:41:00 -04:00
net_config.py fixes AttributeError: 'Task' object has no attribute '_block' 2016-09-16 22:04:22 -04:00
net_template.py net_template doesn't need BOOLEANS 2016-11-22 11:49:21 -05:00
normal.py better module error handling 2015-12-22 23:01:56 -05:00
nxos_config.py updates nxos shared module refactor 2016-08-21 08:57:49 -04:00
nxos_template.py initial add of action plugin nxos_template 2016-02-01 11:52:50 -05:00
ops_config.py minor bug fixes in openswitch shared module 2016-08-30 23:04:41 -04:00
ops_template.py Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
package.py using delegated host's facts when delegating (#17489) 2016-09-09 17:26:47 -04:00
patch.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
pause.py if seconds are specified, min is 1 2016-06-27 09:36:15 -04:00
raw.py raw now returns changed: true (#17112) 2016-08-16 20:39:23 -07:00
script.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
service.py corrected service filtered option to singular 2016-11-16 10:12:47 -05:00
set_fact.py Migrate basestring to a python3 compatible type (#17199) 2016-08-23 13:13:44 -07:00
sros_config.py initial add of shared modules for supporting Nokia SROS devices 2016-08-25 11:47:00 -04:00
synchronize.py Clean up shebangs for various files. 2016-11-02 17:00:27 -07:00
template.py always template when called from template (#18490) 2016-11-15 15:16:46 -05:00
unarchive.py Clean up unarchive action plugin (#17429) 2016-09-09 09:27:38 -04:00
vyos_config.py add vyos action plugin for handling local operations 2016-07-15 08:30:21 -04:00
win_copy.py Two fixes to action plugins 2015-10-22 16:07:26 -07:00
win_reboot.py Move uses of to_bytes, to_text, to_native to use the module_utils version (#17423) 2016-09-06 22:54:17 -07:00
win_template.py Two fixes to action plugins 2015-10-22 16:07:26 -07:00