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
a5e2fae2
Commit
a5e2fae2
authored
Dec 16, 2013
by
jctanner
Committed by
James Tanner
Dec 18, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge pull request #5178 from cavassin/devel
Prevents UnicodeEncodeError
parent
92c983aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
lib/ansible/callbacks.py
+8
-2
lib/ansible/module_common.py
+4
-1
No files found.
lib/ansible/callbacks.py
View file @
a5e2fae2
...
...
@@ -128,9 +128,15 @@ def display(msg, color=None, stderr=False, screen_only=False, log_only=False, ru
msg2
=
stringc
(
msg
,
color
)
if
not
log_only
:
if
not
stderr
:
print
msg2
try
:
print
msg2
except
UnicodeEncodeError
:
print
msg2
.
encode
(
'utf-8'
)
else
:
print
>>
sys
.
stderr
,
msg2
try
:
print
>>
sys
.
stderr
,
msg2
except
UnicodeEncodeError
:
print
>>
sys
.
stderr
,
msg2
.
encode
(
'utf-8'
)
if
constants
.
DEFAULT_LOG_PATH
!=
''
:
while
msg
.
startswith
(
"
\n
"
):
msg
=
msg
.
replace
(
"
\n
"
,
""
)
...
...
lib/ansible/module_common.py
View file @
a5e2fae2
...
...
@@ -136,7 +136,10 @@ class ModuleReplacer(object):
complex_args_json
=
utils
.
jsonify
(
complex_args
)
# We force conversion of module_args to str because module_common calls shlex.split,
# a standard library function that incorrectly handles Unicode input before Python 2.7.3.
encoded_args
=
repr
(
module_args
.
encode
(
'utf-8'
))
try
:
encoded_args
=
repr
(
module_args
.
encode
(
'utf-8'
))
except
UnicodeDecodeError
:
encoded_args
=
repr
(
module_args
)
encoded_lang
=
repr
(
C
.
DEFAULT_MODULE_LANG
)
encoded_complex
=
repr
(
complex_args_json
)
...
...
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