Created
March 3, 2016 01:17
-
-
Save cswingler/b4cc0a0fa0e1edba850d 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
#!/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') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works against FreeIPA 3.0, by the way, 4.0 moves from an XML-RPC to a JSON-RPC.