|
|
|
@ -21,7 +21,13 @@ __metaclass__ = type
|
|
|
|
|
|
|
|
|
|
from ansible.plugins.callback.default import CallbackModule as CallbackModule_default
|
|
|
|
|
from ansible.utils.color import colorize, hostcolor
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
|
|
|
|
|
HAS_OD = False
|
|
|
|
|
try:
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
|
HAS_OD = True
|
|
|
|
|
except ImportError:
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
from __main__ import display
|
|
|
|
@ -153,32 +159,38 @@ class CallbackModule_dense(CallbackModule_default):
|
|
|
|
|
# From CallbackModule
|
|
|
|
|
self._display = display
|
|
|
|
|
|
|
|
|
|
self.super_ref = super(CallbackModule, self)
|
|
|
|
|
self.super_ref.__init__()
|
|
|
|
|
|
|
|
|
|
# Attributes to remove from results for more density
|
|
|
|
|
self.removed_attributes = (
|
|
|
|
|
# 'changed',
|
|
|
|
|
'delta',
|
|
|
|
|
# 'diff',
|
|
|
|
|
'end',
|
|
|
|
|
'failed',
|
|
|
|
|
'failed_when_result',
|
|
|
|
|
'invocation',
|
|
|
|
|
'start',
|
|
|
|
|
'stdout_lines',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Initiate data structures
|
|
|
|
|
self.hosts = OrderedDict()
|
|
|
|
|
self.keep = False
|
|
|
|
|
self.shown_title = False
|
|
|
|
|
self.count = dict(play=0, handler=0, task=0)
|
|
|
|
|
self.type = 'foo'
|
|
|
|
|
if HAS_OD:
|
|
|
|
|
|
|
|
|
|
self.disabled = False
|
|
|
|
|
self.super_ref = super(CallbackModule, self)
|
|
|
|
|
self.super_ref.__init__()
|
|
|
|
|
|
|
|
|
|
# Attributes to remove from results for more density
|
|
|
|
|
self.removed_attributes = (
|
|
|
|
|
# 'changed',
|
|
|
|
|
'delta',
|
|
|
|
|
# 'diff',
|
|
|
|
|
'end',
|
|
|
|
|
'failed',
|
|
|
|
|
'failed_when_result',
|
|
|
|
|
'invocation',
|
|
|
|
|
'start',
|
|
|
|
|
'stdout_lines',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Start immediately on the first line
|
|
|
|
|
sys.stdout.write(vt100.reset + vt100.save + vt100.clearline)
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
# Initiate data structures
|
|
|
|
|
self.hosts = OrderedDict()
|
|
|
|
|
self.keep = False
|
|
|
|
|
self.shown_title = False
|
|
|
|
|
self.count = dict(play=0, handler=0, task=0)
|
|
|
|
|
self.type = 'foo'
|
|
|
|
|
|
|
|
|
|
# Start immediately on the first line
|
|
|
|
|
sys.stdout.write(vt100.reset + vt100.save + vt100.clearline)
|
|
|
|
|
sys.stdout.flush()
|
|
|
|
|
else:
|
|
|
|
|
display.warning("The 'dense' callback plugin requires OrderedDict which is not available in this version of python, disabling.")
|
|
|
|
|
self.disabled = True
|
|
|
|
|
|
|
|
|
|
def __del__(self):
|
|
|
|
|
sys.stdout.write(vt100.restore + vt100.reset + '\n' + vt100.save + vt100.clearline)
|
|
|
|
@ -478,7 +490,7 @@ class CallbackModule_dense(CallbackModule_default):
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# When using -vv or higher, simply do the default action
|
|
|
|
|
if display.verbosity >= 2:
|
|
|
|
|
if display.verbosity >= 2 or not HAS_OD:
|
|
|
|
|
CallbackModule = CallbackModule_default
|
|
|
|
|
else:
|
|
|
|
|
CallbackModule = CallbackModule_dense
|
|
|
|
|
CallbackModule = CallbackModule_dense
|
|
|
|
|