Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2015 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/d7f1c7f98271dd5bc888 to your computer and use it in GitHub Desktop.
Save anonymous/d7f1c7f98271dd5bc888 to your computer and use it in GitHub Desktop.
#master
import salt.config
import salt.utils.event
opts = salt.config.client_config('/etc/salt/master')
event = salt.utils.event.get_event(
'testtag',
sock_dir=opts['sock_dir'],
transport=opts['transport'],
opts=opts)
data = event.get_event()
for data in event.iter_events(full=True):
print(data)
#minion
import salt.client
caller = salt.client.Caller()
caller.sminion.functions['event.fire_master'](
'myco/myevent/success',
{
'success': True,
'message': "It works!",
'testtag':'completed'
}
)
@UtahDave
Copy link

UtahDave commented Sep 8, 2015

import salt.client
caller = salt.client.Caller()
caller.sminion.functions['event.fire_master']('mydata', 'testtag')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment