From 99730ee5343ebadfa8a193db9b1cdfeb337405f8 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Jun 07 2018 09:53:21 +0000 Subject: Retry ODCS requests on 401 error. --- diff --git a/freshmaker/odcsclient.py b/freshmaker/odcsclient.py index 8b88d1a..75bfadb 100644 --- a/freshmaker/odcsclient.py +++ b/freshmaker/odcsclient.py @@ -57,16 +57,16 @@ def create_odcs_client(): Create instance of ODCS according to configured authentication mechasnim """ if conf.odcs_auth_mech == 'kerberos': - return ODCS(conf.odcs_server_url, - auth_mech=AuthMech.Kerberos, - verify_ssl=conf.odcs_verify_ssl) + return RetryingODCS(conf.odcs_server_url, + auth_mech=AuthMech.Kerberos, + verify_ssl=conf.odcs_verify_ssl) elif conf.odcs_auth_mech == 'openidc': if not conf.odcs_openidc_token: raise ValueError('Missing OpenIDC token in configuration.') - return ODCS(conf.odcs_server_url, - auth_mech=AuthMech.OpenIDC, - openidc_token=conf.odcs_openidc_token, - verify_ssl=conf.odcs_verify_ssl) + return RetryingODCS(conf.odcs_server_url, + auth_mech=AuthMech.OpenIDC, + openidc_token=conf.odcs_openidc_token, + verify_ssl=conf.odcs_verify_ssl) else: raise ValueError( 'Authentication mechanism {0} is not supported yet.'.format(