ceph: Allow to configure timeout

This change introduces ceph_timeout option to
set ceph connection/operation timeout.

(cherry picked from commit 19f48d42d2)
Change-Id: I3bc7d1d05d0c6d00215d75ba67dfe0ce37519645
This commit is contained in:
Mehdi Abaakouk 2017-02-22 13:01:49 +01:00
parent cb650e3d73
commit b236ba17cf
1 changed files with 5 additions and 0 deletions

View File

@ -50,6 +50,7 @@ OPTS = [
help='Ceph username (ie: admin without "client." prefix).'),
cfg.StrOpt('ceph_secret', help='Ceph key', secret=True),
cfg.StrOpt('ceph_keyring', help='Ceph keyring path.'),
cfg.IntOpt('ceph_timeout', help='Ceph connection timeout'),
cfg.StrOpt('ceph_conffile',
default='/etc/ceph/ceph.conf',
help='Ceph configuration file.'),
@ -68,6 +69,10 @@ class CephStorage(_carbonara.CarbonaraBasedStorage):
options['keyring'] = conf.ceph_keyring
if conf.ceph_secret:
options['key'] = conf.ceph_secret
if conf.ceph_timeout:
options['rados_osd_op_timeout'] = conf.ceph_timeout
options['rados_mon_op_timeout'] = conf.ceph_timeout
options['client_mount_timeout'] = conf.ceph_timeout
if not rados:
raise ImportError("No module named 'rados' nor 'cradox'")