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
d78c2fc2
Commit
d78c2fc2
authored
Jul 28, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now reports per task item
parent
2d90cbf7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
lib/ansible/plugins/callback/__init__.py
+16
-0
lib/ansible/plugins/callback/default.py
+6
-0
No files found.
lib/ansible/plugins/callback/__init__.py
View file @
d78c2fc2
...
@@ -22,6 +22,7 @@ __metaclass__ = type
...
@@ -22,6 +22,7 @@ __metaclass__ = type
import
json
import
json
import
difflib
import
difflib
import
warnings
import
warnings
from
copy
import
deepcopy
from
six
import
string_types
from
six
import
string_types
...
@@ -100,6 +101,21 @@ class CallbackBase:
...
@@ -100,6 +101,21 @@ class CallbackBase:
except
UnicodeDecodeError
:
except
UnicodeDecodeError
:
return
">> the files are different, but the diff library cannot compare unicode strings"
return
">> the files are different, but the diff library cannot compare unicode strings"
def
_process_items
(
self
,
result
):
for
res
in
result
.
_result
[
'results'
]:
import
q
q
(
res
)
newres
=
deepcopy
(
result
)
newres
.
_result
=
res
if
'failed'
in
res
and
res
[
'failed'
]:
self
.
v2_runner_on_failed
(
newres
)
else
:
self
.
v2_runner_on_ok
(
newres
)
del
result
.
_result
[
'results'
]
def
set_play_context
(
self
,
play_context
):
def
set_play_context
(
self
,
play_context
):
pass
pass
...
...
lib/ansible/plugins/callback/default.py
View file @
d78c2fc2
...
@@ -46,6 +46,9 @@ class CallbackModule(CallbackBase):
...
@@ -46,6 +46,9 @@ class CallbackModule(CallbackBase):
# finally, remove the exception from the result so it's not shown every time
# finally, remove the exception from the result so it's not shown every time
del
result
.
_result
[
'exception'
]
del
result
.
_result
[
'exception'
]
if
result
.
_task
.
loop
and
'results'
in
result
.
_result
:
self
.
_process_items
(
result
)
self
.
_display
.
display
(
"fatal: [
%
s]: FAILED! =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
)),
color
=
'red'
)
self
.
_display
.
display
(
"fatal: [
%
s]: FAILED! =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
)),
color
=
'red'
)
if
result
.
_task
.
ignore_errors
:
if
result
.
_task
.
ignore_errors
:
...
@@ -63,6 +66,9 @@ class CallbackModule(CallbackBase):
...
@@ -63,6 +66,9 @@ class CallbackModule(CallbackBase):
msg
=
"ok: [
%
s]"
%
result
.
_host
.
get_name
()
msg
=
"ok: [
%
s]"
%
result
.
_host
.
get_name
()
color
=
'green'
color
=
'green'
if
result
.
_task
.
loop
and
'results'
in
result
.
_result
:
self
.
_process_items
(
result
)
if
(
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always'
in
result
.
_result
)
and
not
'_ansible_verbose_override'
in
result
.
_result
and
result
.
_task
.
action
!=
'include'
:
if
(
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always'
in
result
.
_result
)
and
not
'_ansible_verbose_override'
in
result
.
_result
and
result
.
_task
.
action
!=
'include'
:
msg
+=
" =>
%
s"
%
self
.
_dump_results
(
result
.
_result
)
msg
+=
" =>
%
s"
%
self
.
_dump_results
(
result
.
_result
)
self
.
_display
.
display
(
msg
,
color
=
color
)
self
.
_display
.
display
(
msg
,
color
=
color
)
...
...
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