From 57454ab2e050a060284f6288b6507986def48de2 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: May 21 2018 07:03:53 +0000 Subject: Try removing krbContext which fails to refresh expired tickets. --- diff --git a/freshmaker/utils.py b/freshmaker/utils.py index d79ae7a..a1218ce 100644 --- a/freshmaker/utils.py +++ b/freshmaker/utils.py @@ -35,7 +35,6 @@ import kobo.rpmlib from freshmaker import conf, app, log from freshmaker.types import ArtifactType -from krbcontext import krbContext from flask import has_app_context, url_for @@ -115,23 +114,16 @@ def get_rebuilt_nvr(artifact_type, nvr): return rebuilt_nvr -def krb_context(): - log.info("Creating Kerberos context with ccache: %r", - conf.krb_auth_ccache_file) - if conf.krb_auth_use_keytab: - krb_ctx_opts = { - 'using_keytab': conf.krb_auth_use_keytab, - 'principal': conf.krb_auth_principal, - 'keytab_file': conf.krb_auth_client_keytab, - 'ccache_file': conf.krb_auth_ccache_file, - } - else: - krb_ctx_opts = { - 'principal': conf.krb_auth_principal, - 'ccache_file': conf.krb_auth_ccache_file, - } +class krbContext(object): + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass - return krbContext(**krb_ctx_opts) + +def krb_context(): + return krbContext() def load_class(location):