mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
output: new state output 'changes'
It displays states result in 'full' mode unless nothing changed, in which case it displays results in 'terse' mode.
This commit is contained in:
parent
c09323d276
commit
5f473bb17e
@ -358,6 +358,7 @@ The state_output setting changes if the output is the full multi line
|
||||
output for each changed state if set to 'full', but if set to 'terse'
|
||||
the output will be shortened to a single line. If set to 'mixed', the output
|
||||
will be terse unless a state failed, in which case that output will be full.
|
||||
If set to 'changes', the output will be fill unless the state didn't change.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
|
@ -86,6 +86,13 @@ def output(data):
|
||||
msg = _format_terse(tcolor, comps, ret, colors)
|
||||
hstrs.append(msg)
|
||||
continue
|
||||
elif __opts__.get('state_output', 'full').lower() == 'changes':
|
||||
# Print terse if no error and no changes, otherwise, be
|
||||
# verbose
|
||||
if ret['result'] is not False and not ret['changes']:
|
||||
msg = _format_terse(tcolor, comps, ret, colors)
|
||||
hstrs.append(msg)
|
||||
continue
|
||||
hstrs.append(('{0}----------\n State: - {1}{2[ENDC]}'
|
||||
.format(tcolor, comps[0], colors)))
|
||||
hstrs.append(' {0}Name: {1}{2[ENDC]}'.format(
|
||||
|
Loading…
Reference in New Issue
Block a user