From e0b317787cf08ea072efba857488fd13be66ef68 Mon Sep 17 00:00:00 2001 From: Pradeep Kilambi Date: Fri, 6 Nov 2015 15:48:35 -0500 Subject: [PATCH] Make swift timeout configurable Change-Id: I512b01c82310d923537015abef2f6ac1cfd45569 Closes-Bug: #1512329 --- gnocchi/storage/swift.py | 7 ++++++- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gnocchi/storage/swift.py b/gnocchi/storage/swift.py index a8f5966a5..651aa5656 100644 --- a/gnocchi/storage/swift.py +++ b/gnocchi/storage/swift.py @@ -52,6 +52,10 @@ OPTS = [ cfg.StrOpt('swift_container_prefix', default='gnocchi', help='Prefix to namespace metric containers.'), + cfg.IntOpt('swift_timeout', + min=0, + default=300, + help='Connection timeout in seconds.'), ] @@ -68,7 +72,8 @@ class SwiftStorage(_carbonara.CarbonaraBasedStorage): preauthtoken=conf.swift_preauthtoken, user=conf.swift_user, key=conf.swift_key, - tenant_name=conf.swift_tenant_name) + tenant_name=conf.swift_tenant_name, + timeout=conf.swift_timeout) self._lock = _carbonara.CarbonaraBasedStorageToozLock(conf) self._container_prefix = conf.swift_container_prefix self.swift.put_container(self.MEASURE_PREFIX) diff --git a/requirements.txt b/requirements.txt index 636049af8..c2cc14bb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ oslo.utils>=1.6.0 oslosphinx>=2.2.0 # Apache-2.0 pandas>=0.17.0 pecan>=0.9 -python-swiftclient +python-swiftclient>=2.5.0 pytimeparse>=1.1.5 futures requests