-
-
Save jalons/f70e9d282cbb903d27e6 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
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