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
9f2999df
Commit
9f2999df
authored
Mar 06, 2014
by
James Cammarata
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Un-escape newlines in delimiters for assemble module
parent
d76f49a8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
lib/ansible/runner/action_plugins/assemble.py
+6
-0
library/files/assemble
+2
-0
No files found.
lib/ansible/runner/action_plugins/assemble.py
View file @
9f2999df
...
@@ -39,7 +39,13 @@ class ActionModule(object):
...
@@ -39,7 +39,13 @@ class ActionModule(object):
for
f
in
sorted
(
os
.
listdir
(
src_path
)):
for
f
in
sorted
(
os
.
listdir
(
src_path
)):
fragment
=
"
%
s/
%
s"
%
(
src_path
,
f
)
fragment
=
"
%
s/
%
s"
%
(
src_path
,
f
)
if
delimit_me
and
delimiter
:
if
delimit_me
and
delimiter
:
# en-escape things like new-lines
delimiter
=
delimiter
.
decode
(
'unicode-escape'
)
tmp
.
write
(
delimiter
)
tmp
.
write
(
delimiter
)
# always make sure there's a newline after the
# delimiter, so lines don't run together
if
delimiter
[
-
1
]
!=
'
\n
'
:
tmp
.
write
(
'
\n
'
)
if
os
.
path
.
isfile
(
fragment
):
if
os
.
path
.
isfile
(
fragment
):
tmp
.
write
(
file
(
fragment
)
.
read
())
tmp
.
write
(
file
(
fragment
)
.
read
())
delimit_me
=
True
delimit_me
=
True
...
...
library/files/assemble
View file @
9f2999df
...
@@ -107,6 +107,8 @@ def assemble_from_fragments(src_path, delimiter=None, compiled_regexp=None):
...
@@ -107,6 +107,8 @@ def assemble_from_fragments(src_path, delimiter=None, compiled_regexp=None):
continue
continue
fragment
=
"
%
s/
%
s"
%
(
src_path
,
f
)
fragment
=
"
%
s/
%
s"
%
(
src_path
,
f
)
if
delimit_me
and
delimiter
:
if
delimit_me
and
delimiter
:
# un-escape anything like newlines
delimiter
=
delimiter
.
decode
(
'unicode-escape'
)
tmp
.
write
(
delimiter
)
tmp
.
write
(
delimiter
)
# always make sure there's a newline after the
# always make sure there's a newline after the
# delimiter, so lines don't run together
# delimiter, so lines don't run together
...
...
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