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
f88d13ac
Commit
f88d13ac
authored
Apr 06, 2013
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2590 from zecrazytux/utf-8
Makes $PIPE and $FILE macros accept utf-8 input
parents
12bcd4ad
b94bf051
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
3 deletions
+4
-3
lib/ansible/runner/lookup_plugins/file.py
+2
-1
lib/ansible/runner/lookup_plugins/pipe.py
+1
-1
lib/ansible/utils/template.py
+1
-1
No files found.
lib/ansible/runner/lookup_plugins/file.py
View file @
f88d13ac
...
...
@@ -17,6 +17,7 @@
from
ansible
import
utils
,
errors
import
os
import
codecs
class
LookupModule
(
object
):
...
...
@@ -31,5 +32,5 @@ class LookupModule(object):
path
=
utils
.
path_dwim
(
self
.
basedir
,
term
)
if
not
os
.
path
.
exists
(
path
):
raise
errors
.
AnsibleError
(
"
%
s does not exist"
%
path
)
ret
.
append
(
open
(
path
)
.
read
()
.
rstrip
())
ret
.
append
(
codecs
.
open
(
path
,
encoding
=
"utf8"
)
.
read
()
.
rstrip
())
return
ret
lib/ansible/runner/lookup_plugins/pipe.py
View file @
f88d13ac
...
...
@@ -31,7 +31,7 @@ class LookupModule(object):
p
=
subprocess
.
Popen
(
term
,
cwd
=
self
.
basedir
,
shell
=
True
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
)
(
stdout
,
stderr
)
=
p
.
communicate
()
if
p
.
returncode
==
0
:
ret
.
append
(
stdout
.
rstrip
())
ret
.
append
(
stdout
.
decode
(
"utf-8"
)
.
rstrip
())
else
:
raise
errors
.
AnsibleError
(
"lookup_plugin.pipe(
%
s) returned
%
d"
%
(
term
,
p
.
returncode
))
return
ret
lib/ansible/utils/template.py
View file @
f88d13ac
...
...
@@ -176,7 +176,7 @@ def _varFind(basedir, text, vars, lookup_fatal, depth, expand_lists):
try
:
replacement
=
instance
.
run
(
args
,
inject
=
vars
)
if
expand_lists
:
replacement
=
","
.
join
([
str
(
x
)
for
x
in
replacement
])
replacement
=
","
.
join
([
unicode
(
x
)
for
x
in
replacement
])
except
:
if
not
lookup_fatal
:
replacement
=
None
...
...
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