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
96f257ce
Commit
96f257ce
authored
Sep 04, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix invocation-output-supression code to still provide invocation data to the callbacks.
parent
2843e31e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
lib/ansible/callbacks.py
+14
-14
No files found.
lib/ansible/callbacks.py
View file @
96f257ce
...
...
@@ -266,9 +266,9 @@ class CliRunnerCallbacks(DefaultRunnerCallbacks):
def
_on_any
(
self
,
host
,
result
):
result2
=
result
.
copy
()
result2
.
pop
(
'invocation'
,
None
)
print
host_report_msg
(
host
,
self
.
options
.
module_name
,
result
,
self
.
options
.
one_line
)
print
host_report_msg
(
host
,
self
.
options
.
module_name
,
result
2
,
self
.
options
.
one_line
)
if
self
.
options
.
tree
:
utils
.
write_tree_file
(
self
.
options
.
tree
,
host
,
utils
.
jsonify
(
result
,
format
=
True
))
utils
.
write_tree_file
(
self
.
options
.
tree
,
host
,
utils
.
jsonify
(
result
2
,
format
=
True
))
########################################################################
...
...
@@ -292,14 +292,14 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
def
on_failed
(
self
,
host
,
results
,
ignore_errors
=
False
):
results
=
results
.
copy
()
results
.
pop
(
'invocation'
,
None
)
results
2
=
results
.
copy
()
results
2
.
pop
(
'invocation'
,
None
)
item
=
results
.
get
(
'item'
,
None
)
item
=
results
2
.
get
(
'item'
,
None
)
if
item
:
msg
=
"failed: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
results
))
msg
=
"failed: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
results
2
))
else
:
msg
=
"failed: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
results
))
msg
=
"failed: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
results
2
))
print
stringc
(
msg
,
'red'
)
if
ignore_errors
:
print
stringc
(
"...ignoring"
,
'yellow'
)
...
...
@@ -308,12 +308,12 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
def
on_ok
(
self
,
host
,
host_result
):
item
=
host_result
.
get
(
'item'
,
None
)
host_result
=
host_result
.
copy
()
host_result
.
pop
(
'invocation'
,
None
)
host_result
2
=
host_result
.
copy
()
host_result
2
.
pop
(
'invocation'
,
None
)
# show verbose output for non-setup module results if --verbose is used
msg
=
''
if
not
self
.
verbose
or
host_result
.
get
(
"verbose_override"
,
None
)
is
not
None
:
if
not
self
.
verbose
or
host_result
2
.
get
(
"verbose_override"
,
None
)
is
not
None
:
if
item
:
msg
=
"ok: [
%
s] => (item=
%
s)"
%
(
host
,
item
)
else
:
...
...
@@ -322,13 +322,13 @@ class PlaybookRunnerCallbacks(DefaultRunnerCallbacks):
else
:
# verbose ...
if
item
:
msg
=
"ok: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
host_result
))
msg
=
"ok: [
%
s] => (item=
%
s) =>
%
s"
%
(
host
,
item
,
utils
.
jsonify
(
host_result
2
))
else
:
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result
:
msg
=
"ok: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
host_result
))
if
'ansible_job_id'
not
in
host_result
or
'finished'
in
host_result
2
:
msg
=
"ok: [
%
s] =>
%
s"
%
(
host
,
utils
.
jsonify
(
host_result
2
))
if
msg
!=
''
:
if
not
'changed'
in
host_result
or
not
host_result
[
'changed'
]:
if
not
'changed'
in
host_result
2
or
not
host_result
[
'changed'
]:
print
stringc
(
msg
,
'green'
)
else
:
print
stringc
(
msg
,
'yellow'
)
...
...
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