From b736451a7d9a2b9f7af979467a5b6f9f9105839c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Jaber?= Date: Tue, 24 Jun 2014 17:04:35 -0430 Subject: [PATCH] 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) --- salt/output/highstate.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/salt/output/highstate.py b/salt/output/highstate.py index d55832e6c6..c9b84a1d0e 100644 --- a/salt/output/highstate.py +++ b/salt/output/highstate.py @@ -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