Add timeout for Swift service
Connection class has timeout parameter but SwiftService and shell don't use it. That can lead to an endless wait when network is unreachable. Change-Id: Iafa42fc2f8b56feefa2bc8ea6a1b8845717d3bab
This commit is contained in:
parent
20d837a276
commit
95f68cd673
swiftclient
@ -273,6 +273,7 @@ def get_conn(options):
|
||||
return Connection(options['auth'],
|
||||
options['user'],
|
||||
options['key'],
|
||||
timeout=options.get('timeout'),
|
||||
retries=options['retries'],
|
||||
auth_version=options['auth_version'],
|
||||
os_options=options['os_options'],
|
||||
|
@ -1728,6 +1728,9 @@ def add_default_args(parser):
|
||||
parser.add_argument('-K', '--key', dest='key',
|
||||
default=environ.get('ST_KEY'),
|
||||
help='Key for obtaining an auth token.')
|
||||
parser.add_argument('-T', '--timeout', type=int, dest='timeout',
|
||||
default=None,
|
||||
help='Timeout in seconds to wait for response.')
|
||||
parser.add_argument('-R', '--retries', type=int, default=5, dest='retries',
|
||||
help='The number of times to retry a failed '
|
||||
'connection.')
|
||||
|
Loading…
x
Reference in New Issue
Block a user