From 1daf319a19f902d7c7bef37af065cac81be9189e Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Wed, 22 Oct 2008 17:54:04 -0400 Subject: Implement the host commands In order for this to work against a v1 database the update host.update needs to be applied --- ipalib/util.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ipalib/util.py') diff --git a/ipalib/util.py b/ipalib/util.py index b60bfc8a..184c6d7c 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -20,6 +20,7 @@ """ Various utility functions. """ +import krbV def xmlrpc_marshal(*args, **kw): """ @@ -39,3 +40,11 @@ def xmlrpc_unmarshal(*params): else: kw = {} return (params[1:], kw) + +def get_current_principal(): + try: + return krbV.default_context().default_ccache().principal().name + except krbV.Krb5Error: + #TODO: do a kinit + print "Unable to get kerberos principal" + return None -- cgit