mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Added rendering option to the highstate outputter
- Added an option to the minion config file that allows to return information only for those states that changed or failed, skipping all successfull states (issue #12648)
This commit is contained in:
parent
7998d914ca
commit
b736451a7d
@ -68,6 +68,9 @@ def output(data):
|
||||
|
||||
|
||||
def _format_host(host, data):
|
||||
#import pdb
|
||||
#pdb.set_trace()
|
||||
|
||||
colors = salt.utils.get_colors(__opts__.get('color'))
|
||||
tabular = __opts__.get('state_tabular', False)
|
||||
rcounts = {}
|
||||
@ -106,6 +109,11 @@ def _format_host(host, data):
|
||||
# Increment result counts
|
||||
rcounts.setdefault(ret['result'], 0)
|
||||
rcounts[ret['result']] += 1
|
||||
|
||||
# Skip this state if it was successfull & diff output was requested
|
||||
if __opts__.get('state_diff', False) and ret['result']:
|
||||
continue
|
||||
|
||||
tcolor = colors['GREEN']
|
||||
schanged, ctext = _format_changes(ret['changes'])
|
||||
nchanges += 1 if schanged else 0
|
||||
|
Loading…
Reference in New Issue
Block a user