Skip to content

Instantly share code, notes, and snippets.

@micahhausler
Created November 15, 2013 17:01
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 micahhausler/7487800 to your computer and use it in GitHub Desktop.
Save micahhausler/7487800 to your computer and use it in GitHub Desktop.
Salt Key Interface
import salt.client
from salt.key import Key
client = salt.client.LocalClient()
ret = client.cmd('saltmaster','test.get_opts',[], username='username', password='password', eauth='pam')
opts = ret['saltmaster']
opts['pki_dir'] = '/etc/salt/pki/master/'
kcli = Key(opts)
kcli.all_keys()
# Can call any method on Key
# https://github.com/saltstack/salt/blob/develop/salt/key.py#L309
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment