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
5f8db9cd
Commit
5f8db9cd
authored
Jul 27, 2015
by
Brian Coca
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed verbose_override to the new _ansible_verbose_override to keep in line with previous changes
output now defaults back to having indent=4
parent
8746e692
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
18 deletions
+15
-18
lib/ansible/module_utils/facts.py
+1
-1
lib/ansible/plugins/callback/__init__.py
+9
-12
lib/ansible/plugins/callback/default.py
+2
-2
lib/ansible/plugins/callback/log_plays.py
+2
-2
lib/ansible/plugins/callback/skippy.py
+1
-1
No files found.
lib/ansible/module_utils/facts.py
View file @
5f8db9cd
...
...
@@ -2874,6 +2874,6 @@ def get_all_facts(module):
setup_result
[
'ansible_facts'
][
k
]
=
v
# hack to keep --verbose from showing all the setup module results
setup_result
[
'verbose_override'
]
=
True
setup_result
[
'
_ansible_
verbose_override'
]
=
True
return
setup_result
lib/ansible/plugins/callback/__init__.py
View file @
5f8db9cd
...
...
@@ -50,20 +50,17 @@ 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
=
None
,
sort_keys
=
True
):
def
_dump_results
(
self
,
result
,
indent
=
4
,
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"
))
else
:
if
'_ansible_verbose_always'
in
result
:
indent
=
4
# all result keys stating with _ansible_ are internal, so remove
# them from the result before we output anything. We have to save
# the keys off first, as we're modifying the dict (so iteritems()
# won't work here)
for
k
in
result
.
keys
():
if
isinstance
(
k
,
string_types
)
and
k
.
startswith
(
'_ansible_'
):
del
result
[
k
]
return
json
.
dumps
(
result
,
indent
=
indent
,
ensure_ascii
=
False
,
sort_keys
=
sort_keys
)
# 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_'
):
del
result
[
k
]
return
json
.
dumps
(
result
,
indent
=
indent
,
ensure_ascii
=
False
,
sort_keys
=
sort_keys
)
def
_handle_warnings
(
self
,
res
):
''' display warnings, if enabled and any exist in the result '''
...
...
lib/ansible/plugins/callback/default.py
View file @
5f8db9cd
...
...
@@ -63,7 +63,7 @@ class CallbackModule(CallbackBase):
msg
=
"ok: [
%
s]"
%
result
.
_host
.
get_name
()
color
=
'green'
if
(
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always'
in
result
.
_result
)
and
result
.
_task
.
action
not
in
(
'setup'
,
'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
)
self
.
_display
.
display
(
msg
,
color
=
color
)
...
...
@@ -71,7 +71,7 @@ class CallbackModule(CallbackBase):
def
v2_runner_on_skipped
(
self
,
result
):
msg
=
"skipping: [
%
s]"
%
result
.
_host
.
get_name
()
if
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always
'
in
result
.
_result
:
if
(
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always'
in
result
.
_result
)
and
not
'_ansible_verbose_override
'
in
result
.
_result
:
msg
+=
" =>
%
s"
%
self
.
_dump_results
(
result
.
_result
)
self
.
_display
.
display
(
msg
,
color
=
'cyan'
)
...
...
lib/ansible/plugins/callback/log_plays.py
View file @
5f8db9cd
...
...
@@ -48,8 +48,8 @@ class CallbackModule(CallbackBase):
def
log
(
self
,
host
,
category
,
data
):
if
type
(
data
)
==
dict
:
if
'verbose_override'
in
data
:
# avoid logging extraneous data
from facts
if
'
_ansible_
verbose_override'
in
data
:
# avoid logging extraneous data
data
=
'omitted'
else
:
data
=
data
.
copy
()
...
...
lib/ansible/plugins/callback/skippy.py
View file @
5f8db9cd
...
...
@@ -63,7 +63,7 @@ class CallbackModule(CallbackBase):
msg
=
"ok: [
%
s]"
%
result
.
_host
.
get_name
()
color
=
'green'
if
(
self
.
_display
.
verbosity
>
0
or
'_ansible_verbose_always'
in
result
.
_result
)
and
result
.
_task
.
action
not
in
(
'setup'
,
'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
)
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