make timeout of authentication configurable

This commit is contained in:
Yuming Zhu 2018-11-26 15:16:42 +08:00 committed by Mike McLean
parent 31b9e14dfe
commit 2696f35b55
2 changed files with 12 additions and 3 deletions

View file

@ -39,3 +39,9 @@
;enabled plugins for CLI, runroot and save_failed_tree are available
;plugins =
;timeout of XMLRPC requests by seconds, default: 60 * 60 * 12 = 43200
;timeout = 43200
;timeout of GSSAPI/SSL authentication by seconds, default: 60
;auth_timeout = 60

View file

@ -1648,6 +1648,7 @@ def read_config(profile_name, user_config=None):
'offline_retry_interval' : None,
'keepalive' : True,
'timeout' : None,
'auth_timeout' : None,
'use_fast_upload': False,
'upload_blocksize': 1048576,
'poll_interval': 6,
@ -1719,7 +1720,8 @@ def read_config(profile_name, user_config=None):
'debug', 'debug_xmlrpc', 'krb_canon_host'):
result[name] = config.getboolean(profile_name, name)
elif name in ('max_retries', 'retry_interval',
'offline_retry_interval', 'poll_interval', 'timeout',
'offline_retry_interval', 'poll_interval',
'timeout', 'auth_timeout',
'upload_blocksize', 'pyver'):
try:
result[name] = int(value)
@ -2037,6 +2039,7 @@ def grab_session_options(options):
'anon_retry',
'keepalive',
'timeout',
'auth_timeout',
'use_fast_upload',
'upload_blocksize',
'krb_rdns',
@ -2239,7 +2242,7 @@ class ClientSession(object):
old_opts = self.opts
self.opts = old_opts.copy()
try:
self.opts['timeout'] = 60
self.opts['timeout'] = self.opts.get('auth_timeout') or 60
kwargs = {}
if keytab:
old_env['KRB5_CLIENT_KTNAME'] = os.environ.get('KRB5_CLIENT_KTNAME')
@ -2304,7 +2307,7 @@ class ClientSession(object):
# 60 second timeout during login
old_opts = self.opts
self.opts = old_opts.copy()
self.opts['timeout'] = 60
self.opts['timeout'] = self.opts.get('auth_timeout') or 60
self.opts['cert'] = cert
self.opts['serverca'] = serverca
try: