Created
September 8, 2015 17:23
-
-
Save anonymous/d7f1c7f98271dd5bc888 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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
commented
Sep 8, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment