Skip to content

Commit

Permalink
event.send add show_changed option
Browse files Browse the repository at this point in the history
  • Loading branch information
twellspring committed Apr 29, 2018
1 parent b66ddbf commit 33827a5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions salt/states/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
def send(name,
data=None,
preload=None,
show_changed=True,
with_env=False,
with_grains=False,
with_pillar=False,
Expand All @@ -23,7 +24,11 @@ def send(name,
.. versionadded:: 2014.7.0
Accepts the same arguments as the :py:func:`event.send
<salt.modules.event.send>` execution module of the same name.
<salt.modules.event.send>` execution module of the same name,
with the additional argument:
:param show_changed: state will show as changed with the data
argument as the change value. If false, shows as unchanged.
Example:
Expand All @@ -39,7 +44,10 @@ def send(name,
# ...snip bunch of states below
'''
ret = {'name': name, 'changes': {}, 'result': False, 'comment': ''}
ret['changes'] = {'tag': name, 'data': data}
if show_changed:
ret['changes'] = {'tag': name, 'data': data}
else:
ret['changes'] = {}

if __opts__['test']:
ret['result'] = None
Expand Down

0 comments on commit 33827a5

Please sign in to comment.