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
c63189f6
Commit
c63189f6
authored
Sep 25, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make output be cleaner on multi-line failed commands and parse errors.
parent
07101085
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
lib/ansible/callbacks.py
+14
-0
No files found.
lib/ansible/callbacks.py
View file @
c63189f6
...
@@ -296,11 +296,25 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
...
@@ -296,11 +296,25 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
results2
.
pop
(
'invocation'
,
None
)
results2
.
pop
(
'invocation'
,
None
)
item
=
results2
.
get
(
'item'
,
None
)
item
=
results2
.
get
(
'item'
,
None
)
parsed
=
results2
.
get
(
'parsed'
,
True
)
module_msg
=
''
if
not
parsed
:
module_msg
=
results2
.
pop
(
'msg'
,
None
)
stderr
=
results2
.
pop
(
'stderr'
,
None
)
stdout
=
results2
.
pop
(
'stdout'
,
None
)
if
item
:
if
item
:
msg
=
"failed: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
results2
))
msg
=
"failed: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
results2
))
else
:
else
:
msg
=
"failed: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
results2
))
msg
=
"failed: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
results2
))
print
stringc
(
msg
,
'red'
)
print
stringc
(
msg
,
'red'
)
if
stderr
:
print
stringc
(
"stderr:
%
s"
%
stderr
,
'red'
)
if
stdout
:
print
stringc
(
"stdout:
%
s"
%
stdout
,
'red'
)
if
not
parsed
and
module_msg
:
print
stringc
(
"invalid output was:
%
s"
%
module_msg
,
'red'
)
if
ignore_errors
:
if
ignore_errors
:
print
stringc
(
"...ignoring"
,
'yellow'
)
print
stringc
(
"...ignoring"
,
'yellow'
)
super
(
PlaybookRunnerCallbacks
,
self
)
.
on_failed
(
host
,
results
,
ignore_errors
=
ignore_errors
)
super
(
PlaybookRunnerCallbacks
,
self
)
.
on_failed
(
host
,
results
,
ignore_errors
=
ignore_errors
)
...
...
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