Advertisement
Guest User

Untitled

a guest
Aug 13th, 2015
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. def get_salt_caller():
  2. ''' Return a local salt caller instance.
  3.  
  4. If you're trying to debug salt on your local machine, run these:
  5. salt.log.setup_console_logger(log_level='debug')
  6. salt.log.setup.__CONSOLE_CONFIGURED = True
  7. salt.log.set_logger_level('debug')
  8. '''
  9. global _salt_caller
  10.  
  11. try:
  12. return _salt_caller
  13. except NameError:
  14. import salt.client
  15. import salt.config
  16.  
  17. caller_opts = salt.config.minion_config('/etc/salt/minion')
  18. caller_opts['file_client'] = 'local'
  19. _salt_caller = salt.client.Caller(mopts=caller_opts)
  20.  
  21. return _salt_caller
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement