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
fbdddc7c
Commit
fbdddc7c
authored
Aug 11, 2012
by
Dietmar Schinnerl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added utils.last_non_blank_line
parent
993bb5c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
lib/ansible/runner/__init__.py
+2
-2
lib/ansible/utils.py
+12
-1
No files found.
lib/ansible/runner/__init__.py
View file @
fbdddc7c
...
...
@@ -655,7 +655,7 @@ class Runner(object):
cmd
=
" || "
.
join
(
md5s
)
cmd
=
"
%
s;
%
s || (echo
\"
${rc}
%
s
\"
)"
%
(
test
,
cmd
,
path
)
return
utils
.
last_non_blank_line
(
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
sudoable
=
False
))
.
split
()[
0
]
return
utils
.
last_non_blank_line
(
self
.
_low_level_exec_command
(
conn
,
cmd
,
tmp
,
sudoable
=
False
))
# *****************************************************
...
...
@@ -675,7 +675,7 @@ class Runner(object):
cmd
+=
' && echo
%
s'
%
basetmp
result
=
self
.
_low_level_exec_command
(
conn
,
cmd
,
None
,
sudoable
=
False
)
return
utils
.
last_non_blank_line
(
result
.
split
(
"
\n
"
))[
0
]
.
strip
()
+
'/'
return
utils
.
last_non_blank_line
(
result
)
.
strip
()
+
'/'
# *****************************************************
...
...
lib/ansible/utils.py
View file @
fbdddc7c
...
...
@@ -412,7 +412,18 @@ def do_encrypt(result, encrypt, salt_size=None, salt=None):
return
result
def
last_non_blank_line
(
lines
):
return
lines
all_lines
=
lines
.
splitlines
()
all_lines
.
reverse
()
for
line
in
all_lines
:
if
(
len
(
line
)
>
0
):
return
line
return
""
# we shouldn't come here (no lines?) but let's pretend nothing happend
# We can't return all lines here because calling code expects only one
# line.
def
line_needs_filtering
(
line
):
return
line
.
startswith
(
'#'
)
or
(
len
(
line
)
==
0
)
def
filter_leading_garbage
(
lines
):
return
lines
...
...
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