summaryrefslogtreecommitdiffstats
path: root/ipalib/util.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2008-10-22 17:54:04 -0400
committerRob Crittenden <rcritten@redhat.com>2008-10-22 17:54:04 -0400
commit1daf319a19f902d7c7bef37af065cac81be9189e (patch)
tree5d840adb9273b7fa0569477fdf2be68d351d0d69 /ipalib/util.py
parentf189b02996668e5d600f1abed675cb20cd72290f (diff)
downloadfreeipa-1daf319a19f902d7c7bef37af065cac81be9189e.tar.gz
freeipa-1daf319a19f902d7c7bef37af065cac81be9189e.tar.xz
freeipa-1daf319a19f902d7c7bef37af065cac81be9189e.zip
Implement the host commands
In order for this to work against a v1 database the update host.update needs to be applied
Diffstat (limited to 'ipalib/util.py')
-rw-r--r--ipalib/util.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/ipalib/util.py b/ipalib/util.py
index b60bfc8aa..184c6d7c4 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