From 67a454951993b1f04f3feeab7462dcaf6d23fb61 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Fri, 10 Sep 2010 15:57:40 -0400 Subject: Remove some additional instances of krbV from ipa-client Make two krbV imports conditional. These aren't used during a client install so should cause no problems. Also fix the client installer to use the new env option in ipautil.run. We weren't getting the krb5 configuration set in the environment because we were overriding the environment to set the PATH. ticket 136 --- ipalib/util.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ipalib/util.py') diff --git a/ipalib/util.py b/ipalib/util.py index 4aff88f83..6bd1da541 100644 --- a/ipalib/util.py +++ b/ipalib/util.py @@ -25,7 +25,6 @@ import os import imp import logging import time -import krbV import socket from types import NoneType @@ -49,7 +48,11 @@ def json_serialize(obj): def get_current_principal(): try: + # krbV isn't necessarily available on client machines, fail gracefully + import krbV return unicode(krbV.default_context().default_ccache().principal().name) + except ImportError: + raise RuntimeError('python-krbV is not available.') except krbV.Krb5Error: #TODO: do a kinit? raise errors.CCacheError() -- cgit