diff options
author | Pavel Abalikhin <anpavl@gmail.com> | 2022-04-21 17:08:17 +0300 |
---|---|---|
committer | Pavel Abalikhin <anpavl@gmail.com> | 2022-04-21 18:00:27 +0300 |
commit | 95f68cd673afe07aef9d14904de1c974fc684ef2 (patch) | |
tree | ae651cb840a8bdc15d7fe4957ecdbfb9ca3abb80 /swiftclient/shell.py | |
parent | 20d837a27665632cc5b164b96671290b04c48a58 (diff) | |
download | python-swiftclient-95f68cd673afe07aef9d14904de1c974fc684ef2.tar.gz |
Add timeout for Swift service4.0.0
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
Diffstat (limited to 'swiftclient/shell.py')
-rwxr-xr-x | swiftclient/shell.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/swiftclient/shell.py b/swiftclient/shell.py index a16de88..df7c511 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -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.') |