diff options
Diffstat (limited to 'ipa-client/ipa-install/ipa-client-automount')
-rwxr-xr-x | ipa-client/ipa-install/ipa-client-automount | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ipa-client/ipa-install/ipa-client-automount b/ipa-client/ipa-install/ipa-client-automount index 0739a2e6b..4abc853dc 100755 --- a/ipa-client/ipa-install/ipa-client-automount +++ b/ipa-client/ipa-install/ipa-client-automount @@ -26,7 +26,7 @@ import os import urlparse import time import tempfile -from krbV import Krb5Error +import gssapi import SSSDConfig @@ -427,15 +427,14 @@ def main(): print "Location: %s" % options.location root_logger.debug('Using automount location %s' % options.location) - # Verify that the location is valid - (ccache_fd, ccache_name) = tempfile.mkstemp() - os.close(ccache_fd) + ccache_dir = tempfile.mkdtemp() + ccache_name = os.path.join(ccache_dir, 'ccache') try: try: host_princ = str('host/%s@%s' % (api.env.host, api.env.realm)) ipautil.kinit_keytab(host_princ, paths.KRB5_KEYTAB, ccache_name) os.environ['KRB5CCNAME'] = ccache_name - except Krb5Error as e: + except gssapi.exceptions.GSSError as e: sys.exit("Failed to obtain host TGT: %s" % e) # Now we have a TGT, connect to IPA try: @@ -457,6 +456,7 @@ def main(): sys.exit("Cannot connect to the server due to generic error: %s" % str(e)) finally: os.remove(ccache_name) + os.rmdir(ccache_dir) if not options.unattended and not ipautil.user_input("Continue to configure the system with these values?", False): sys.exit("Installation aborted") |