Skip to content

Instantly share code, notes, and snippets.

@cswingler
Created March 3, 2016 01:17
Show Gist options
  • Save cswingler/b4cc0a0fa0e1edba850d to your computer and use it in GitHub Desktop.
Save cswingler/b4cc0a0fa0e1edba850d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# Let's do some dumb things.
from ipalib import api, errors
import sys
api.bootstrap_with_global_options(context='example.org')
api.finalize()
try:
api.Backend.xmlclient.connect()
except errors.CCacheError:
print "You don't have a kerberos token, run kinit and try again."
sys.exit(1)
print "Looking up the admin user"
print api.Command.user_show(u'admin')
@cswingler
Copy link
Author

This works against FreeIPA 3.0, by the way, 4.0 moves from an XML-RPC to a JSON-RPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment