Skip to content

Instantly share code, notes, and snippets.

@jalons
Last active August 29, 2015 13:57
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 jalons/f70e9d282cbb903d27e6 to your computer and use it in GitHub Desktop.
Save jalons/f70e9d282cbb903d27e6 to your computer and use it in GitHub Desktop.
import os
import salt
import salt.client
import salt.runner
import salt.config
master_opts = salt.config.master_config(
os.environ.get('SALT_MASTER_CONFIG', '.virtualenvs/saltdev/etc/master'))
minion_opts = salt.config.minion_config(
os.environ.get('SALT_MINION_CONFIG', '.virtualenvs/saltdev/etc/minion'))
runner = salt.runner.RunnerClient(master_opts)
status = runner.cmd('manage.status', ['output=False'])
print len(status.get('up'))
print len(status.get('down'))
s = salt.client.LocalClient(mopts=master_opts)
fib=s.cmd('*', 'test.fib', [5])
print fib
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment