Created
September 8, 2015 17:50
-
-
Save UtahDave/27c5f1bf13f060185c64 to your computer and use it in GitHub Desktop.
Read Salt Master event bus in python
This file contains hidden or 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
| sudo salt-call event.fire_master 'datatuff' 'testtag' |
This file contains hidden or 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
| import salt.config | |
| import salt.utils.event | |
| from pprint import pprint | |
| opts = salt.config.client_config('/etc/salt/master') | |
| event = salt.utils.event.get_event( | |
| 'master', | |
| sock_dir=opts['sock_dir'], | |
| transport=opts['transport'], | |
| opts=opts) | |
| for item in event.iter_events(tag='testtag'): | |
| pprint(item) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment