Add a configurable setting in barbican-functional.conf for timeouts

When debugging API calls, you often timeout because of breakpoints.
The default value is 10 seconds which isn't long enough for debugging.
This CR makes that setting configurable in barbican-functional.conf
and retains the default of 10 seconds.

Change-Id: I51685d5df903088773cba4ca624bbd0360ed0d16
This commit is contained in:
Steve Heyman 2016-03-21 14:15:33 -05:00
parent 0600a26089
commit 82de5e3175
3 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,9 @@ auditor_b_password=barbican
#region_name=RegionOne #region_name=RegionOne
#endpoint_type=public #endpoint_type=public
# use this to increase the timeout (in seconds) when debugging API calls
#timeout=10
# use this to run the functional tests against a # use this to run the functional tests against a
# different barbican server than the one that is # different barbican server than the one that is
# specified in the service catalog. To use what is # specified in the service catalog. To use what is

View File

@ -31,7 +31,7 @@ CONF = config.get_config()
class BarbicanClient(object): class BarbicanClient(object):
def __init__(self, api_version='v1'): def __init__(self, api_version='v1'):
self.timeout = 10 self.timeout = CONF.keymanager.timeout
self.api_version = api_version self.api_version = api_version
self.default_headers = { self.default_headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',

View File

@ -70,6 +70,7 @@ def setup_config(config_file=''):
cfg.StrOpt('service_name', default='barbican'), cfg.StrOpt('service_name', default='barbican'),
cfg.StrOpt('region_name', default='RegionOne'), cfg.StrOpt('region_name', default='RegionOne'),
cfg.StrOpt('endpoint_type', default='public'), cfg.StrOpt('endpoint_type', default='public'),
cfg.IntOpt('timeout', default=10),
cfg.StrOpt('override_url', default=''), cfg.StrOpt('override_url', default=''),
cfg.StrOpt('override_url_version', default='') cfg.StrOpt('override_url_version', default='')
] ]