Merge "Rbd: Deprecate unused rados_connect_timeout"

This commit is contained in:
Zuul 2023-02-08 07:26:09 +00:00 committed by Gerrit Code Review
commit 35a4589885
4 changed files with 15 additions and 21 deletions

View File

@ -133,6 +133,13 @@ Related options:
"""),
cfg.IntOpt('rados_connect_timeout', default=0,
deprecated_for_removal=True,
deprecated_since='Zed',
deprecated_reason="""
This option has not had any effect in years. Users willing to set a timeout for
connecting to the Ceph cluster should use 'client_mount_timeout' in Ceph's
configuration file.
""",
help="""
Timeout value for connecting to Ceph cluster.
@ -288,7 +295,7 @@ class Store(driver.Store):
client = rados.Rados(conffile=conffile, rados_id=rados_id)
try:
client.connect(timeout=self.connect_timeout)
client.connect()
except (rados.Error, rados.ObjectNotFound) as e:
if self.backend_group and len(self.conf.enabled_backends) > 1:
reason = _("Error in store configuration: %s") % e
@ -319,8 +326,6 @@ class Store(driver.Store):
user = getattr(self.conf, self.backend_group).rbd_store_user
conf_file = getattr(self.conf,
self.backend_group).rbd_store_ceph_conf
connect_timeout = getattr(
self.conf, self.backend_group).rados_connect_timeout
thin_provisioning = getattr(self.conf,
self.backend_group).\
rbd_thin_provisioning
@ -329,7 +334,6 @@ class Store(driver.Store):
pool = self.conf.glance_store.rbd_store_pool
user = self.conf.glance_store.rbd_store_user
conf_file = self.conf.glance_store.rbd_store_ceph_conf
connect_timeout = self.conf.glance_store.rados_connect_timeout
thin_provisioning = \
self.conf.glance_store.rbd_thin_provisioning
@ -343,7 +347,6 @@ class Store(driver.Store):
self.pool = str(pool)
self.user = str(user)
self.conf_file = str(conf_file)
self.connect_timeout = connect_timeout
except cfg.ConfigFileValueError as e:
reason = _("Error in store configuration: %s") % e
LOG.error(reason)

View File

@ -450,14 +450,6 @@ class TestMultiStore(base.MultiStoreBaseTest,
self.assertRaises(exceptions.StoreRandomGetNotSupported,
self.store.get, loc, chunk_size=1)
@mock.patch.object(MockRados.Rados, 'connect')
def test_rados_connect_timeout(self, mock_rados_connect):
socket_timeout = 1
self.config(rados_connect_timeout=socket_timeout, group="ceph1")
self.store.configure()
with self.store.get_connection('conffile', 'rados_id'):
mock_rados_connect.assert_called_with(timeout=socket_timeout)
@mock.patch.object(MockRados.Rados, 'connect', side_effect=MockRados.Error)
def test_rados_connect_error(self, _):
rbd_store.rados.Error = MockRados.Error

View File

@ -656,14 +656,6 @@ class TestStore(base.StoreBaseTest,
self.assertRaises(exceptions.StoreRandomGetNotSupported,
self.store.get, loc, chunk_size=1)
@mock.patch.object(MockRados.Rados, 'connect')
def test_rados_connect_timeout(self, mock_rados_connect):
socket_timeout = 1
self.config(rados_connect_timeout=socket_timeout)
self.store.configure()
with self.store.get_connection('conffile', 'rados_id'):
mock_rados_connect.assert_called_with(timeout=socket_timeout)
@mock.patch.object(MockRados.Rados, 'connect', side_effect=MockRados.Error)
def test_rados_connect_error(self, _):
rbd_store.rados.Error = MockRados.Error

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
The 'rados_connect_timeout' config option for the RBD store has been
deprecated and will be removed in the future. It has been silently ignored
for multiple releases. Users willing to set a timeout for the connection to
the cluster can use Ceph's 'client_mount_timeout' option.