Skip to content

Instantly share code, notes, and snippets.

@pcn
Created October 16, 2018 20:59
Show Gist options
  • Save pcn/be78ab4bdab793bcef147fde385da98b to your computer and use it in GitHub Desktop.
Save pcn/be78ab4bdab793bcef147fde385da98b to your computer and use it in GitHub Desktop.
For some reason, this is not sending anything that I can see with
# I feel like I should be able to see this with
# $ sudo salt-run state.event swi/autoscale/highstate
# But I'm not seeing anything.
def success_message(minion_name):
import salt.client
import json
__opts__ = salt.config.minion_config('/etc/salt/minion')
caller = salt.client.Caller(mopts=__opts__)
caller.cmd('event.send', 'swi/autoscale/highstate', json.dumps({"success": minion_name}))
caller.cmd('event.send', 'swi/autoscale/highstate', data={"success": minion_name})
caller.cmd('event.send', 'swi/autoscale/highstate', {"success": minion_name})
success_message("test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment