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
787a0c4e
Commit
787a0c4e
authored
Jul 28, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed indent issues
parent
77fc3ce7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
lib/ansible/plugins/callback/__init__.py
+4
-1
lib/ansible/plugins/callback/minimal.py
+2
-2
No files found.
lib/ansible/plugins/callback/__init__.py
View file @
787a0c4e
...
...
@@ -50,11 +50,14 @@ class CallbackBase:
version
=
getattr
(
self
,
'CALLBACK_VERSION'
,
'1.0'
)
self
.
_display
.
vvvv
(
'Loaded callback
%
s of type
%
s, v
%
s'
%
(
name
,
ctype
,
version
))
def
_dump_results
(
self
,
result
,
indent
=
4
,
sort_keys
=
True
):
def
_dump_results
(
self
,
result
,
indent
=
None
,
sort_keys
=
True
):
if
result
.
get
(
'_ansible_no_log'
,
False
):
return
json
.
dumps
(
dict
(
censored
=
"the output has been hidden due to the fact that 'no_log: true' was specified for this result"
))
if
not
indent
and
'_ansible_verbose_always'
in
result
and
result
[
'_ansible_verbose_always'
]:
indent
=
4
# All result keys stating with _ansible_ are internal, so remove them from the result before we output anything.
for
k
in
result
.
keys
():
if
isinstance
(
k
,
string_types
)
and
k
.
startswith
(
'_ansible_'
):
...
...
lib/ansible/plugins/callback/minimal.py
View file @
787a0c4e
...
...
@@ -61,13 +61,13 @@ class CallbackModule(CallbackBase):
if
result
.
_task
.
action
in
C
.
MODULE_NO_JSON
:
self
.
_display
.
display
(
self
.
_command_generic_msg
(
result
.
_host
.
get_name
(),
result
.
_result
,
"FAILED"
),
color
=
'red'
)
else
:
self
.
_display
.
display
(
"
%
s | FAILED! =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
)),
color
=
'red'
)
self
.
_display
.
display
(
"
%
s | FAILED! =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
,
indent
=
4
)),
color
=
'red'
)
def
v2_runner_on_ok
(
self
,
result
):
if
result
.
_task
.
action
in
C
.
MODULE_NO_JSON
:
self
.
_display
.
display
(
self
.
_command_generic_msg
(
result
.
_host
.
get_name
(),
result
.
_result
,
"SUCCESS"
),
color
=
'green'
)
else
:
self
.
_display
.
display
(
"
%
s | SUCCESS =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
)),
color
=
'green'
)
self
.
_display
.
display
(
"
%
s | SUCCESS =>
%
s"
%
(
result
.
_host
.
get_name
(),
self
.
_dump_results
(
result
.
_result
,
indent
=
4
)),
color
=
'green'
)
self
.
_handle_warnings
(
result
.
_result
)
def
v2_runner_on_skipped
(
self
,
result
):
...
...
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