From 11210a957c7f21defbbc46826210d93b295cce18 Mon Sep 17 00:00:00 2001 From: Thiago Brito Date: Thu, 24 Mar 2022 15:11:57 -0300 Subject: [PATCH] Fix RequiredOptError when missing lock_path When lock_file is not present on the [oslo_concurrency] section of the config file, we are getting a misleading error saying that it is not preset on the DEFAULT group. This commit fixes it by providing the group arg to the RequiredOptError constructor. Closes-Bug: #1966320 Signed-off-by: Thiago Brito Change-Id: Idee6987739917c7eae4faee15a66085a9ef7f6d2 --- oslo_concurrency/lockutils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oslo_concurrency/lockutils.py b/oslo_concurrency/lockutils.py index 1a9abe8..c75d3a3 100644 --- a/oslo_concurrency/lockutils.py +++ b/oslo_concurrency/lockutils.py @@ -180,7 +180,7 @@ def _get_lock_path(name, lock_file_prefix, lock_path=None): local_lock_path = lock_path or CONF.oslo_concurrency.lock_path if not local_lock_path: - raise cfg.RequiredOptError('lock_path') + raise cfg.RequiredOptError('lock_path', 'oslo_concurrency') return os.path.join(local_lock_path, name)