Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
1cc2135a
Commit
1cc2135a
authored
Mar 30, 2015
by
Toshio Kuratomi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix no closed parens
parent
4aa3ac41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
v2/ansible/plugins/action/copy.py
+10
-5
No files found.
v2/ansible/plugins/action/copy.py
View file @
1cc2135a
...
...
@@ -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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment