summaryrefslogtreecommitdiffstats
path: root/daemons/dnssec/ipa-ods-exporter
diff options
context:
space:
mode:
Diffstat (limited to 'daemons/dnssec/ipa-ods-exporter')
-rwxr-xr-xdaemons/dnssec/ipa-ods-exporter10
1 files changed, 9 insertions, 1 deletions
diff --git a/daemons/dnssec/ipa-ods-exporter b/daemons/dnssec/ipa-ods-exporter
index 4c6649c2f..4d5423797 100755
--- a/daemons/dnssec/ipa-ods-exporter
+++ b/daemons/dnssec/ipa-ods-exporter
@@ -20,6 +20,7 @@ from datetime import datetime
import dateutil.tz
import dns.dnssec
import fcntl
+from krbV import Krb5Error
import logging
import os
import subprocess
@@ -482,7 +483,14 @@ ipalib.api.finalize()
PRINCIPAL = str('%s/%s' % (DAEMONNAME, ipalib.api.env.host))
log.debug('Kerberos principal: %s', PRINCIPAL)
ccache_name = os.path.join(WORKDIR, 'ipa-ods-exporter.ccache')
-ipautil.kinit_keytab(PRINCIPAL, paths.IPA_ODS_EXPORTER_KEYTAB, ccache_name)
+
+try:
+ ipautil.kinit_keytab(PRINCIPAL, paths.IPA_ODS_EXPORTER_KEYTAB, ccache_name,
+ attempts=5)
+except Krb5Error as e:
+ log.critical('Kerberos authentication failed: %s', e)
+ sys.exit(1)
+
os.environ['KRB5CCNAME'] = ccache_name
log.debug('Got TGT')