mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix no closed parens
This commit is contained in:
parent
4aa3ac41a1
commit
1cc2135a0d
1 changed files with 10 additions and 5 deletions
|
@ -31,12 +31,17 @@ from ansible.plugins.action import ActionBase
|
|||
from ansible.utils.boolean import boolean
|
||||
from ansible.utils.hashing import checksum
|
||||
|
||||
### FIXME: Find a different way to fix 3518 as sys.defaultencoding() breaks
|
||||
# the python interpreter in subtle ways. It appears that this does not fix
|
||||
# 3518 anyway (using binary files via lookup(). Instead, it tries to fix
|
||||
# utf-8 strings in the content parameter. That should be fixable by properly
|
||||
# encoding or decoding the value before we write it to a file.
|
||||
#
|
||||
## fixes https://github.com/ansible/ansible/issues/3518
|
||||
# http://mypy.pythonblogs.com/12_mypy/archive/1253_workaround_for_python_bug_ascii_codec_cant_encode_character_uxa0_in_position_111_ordinal_not_in_range128.html
|
||||
|
||||
import sys
|
||||
reload(sys)
|
||||
sys.setdefaultencoding("utf8")
|
||||
#import sys
|
||||
#reload(sys)
|
||||
#sys.setdefaultencoding("utf8")
|
||||
|
||||
|
||||
class ActionModule(ActionBase):
|
||||
|
@ -231,7 +236,7 @@ class ActionModule(ActionBase):
|
|||
self._remove_tempfile_if_content_defined(content, content_tempfile)
|
||||
|
||||
# fix file permissions when the copy is done as a different user
|
||||
if (self._connection_info.become and self._connection_info.become_user != 'root':
|
||||
if self._connection_info.become and self._connection_info.become_user != 'root':
|
||||
self._remote_chmod('a+r', tmp_src, tmp)
|
||||
|
||||
if raw:
|
||||
|
|
Loading…
Reference in a new issue