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:
Captured traceback:
~~~~~~~~~~~~~~~~~~~
Traceback (most recent call last):
File "/home/tbrito/workspace/openstack/nova/nova/tests/unit/virt/test_block_device.py", line 725, in test_volume_attach_with_shared_targets
self.test_volume_attach(include_shared_targets=True)
File "/home/tbrito/workspace/openstack/nova/nova/tests/unit/virt/test_block_device.py", line 721, in test_volume_attach
self._test_volume_attach(test_bdm, self.volume_bdm, volume,
File "/home/tbrito/workspace/openstack/nova/.tox/py39/lib/python3.9/site-packages/mock/mock.py", line 1346, in patched
return func(*newargs, **newkeywargs)
File "/home/tbrito/workspace/openstack/nova/nova/tests/unit/virt/test_block_device.py", line 623, in _test_volume_attach
driver_bdm.attach(self.context, instance,
File "/home/tbrito/workspace/openstack/nova/nova/virt/block_device.py", line 46, in wrapped
ret_val = method(obj, context, *args, **kwargs)
File "/home/tbrito/workspace/openstack/nova/nova/virt/block_device.py", line 668, in attach
with brick_utils.guard_connection(volume):
File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/home/tbrito/workspace/openstack/nova/.tox/py39/lib/python3.9/site-packages/os_brick/initiator/utils.py", line 45, in guard_connection
with lockutils.lock(device['service_uuid'], 'os-brick-',
File "/usr/lib/python3.9/contextlib.py", line 119, in __enter__
return next(self.gen)
File "/home/tbrito/workspace/openstack/nova/.tox/py39/lib/python3.9/site-packages/oslo_concurrency/lockutils.py", line 297, in lock
ext_lock = external_lock(name, lock_file_prefix, lock_path)
File "/home/tbrito/workspace/openstack/nova/.tox/py39/lib/python3.9/site-packages/oslo_concurrency/lockutils.py", line 189, in external_lock
lock_file_path = _get_lock_path(name, lock_file_prefix, lock_path)
File "/home/tbrito/workspace/openstack/nova/.tox/py39/lib/python3.9/site-packages/oslo_concurrency/lockutils.py", line 183, in _get_lock_path
raise cfg.RequiredOptError('lock_path')
oslo_config.cfg.RequiredOptError: value required for option lock_path in group [DEFAULT]
https://github.com/openstack/oslo.concurrency/blob/master/oslo_concurrency/lockutils.py#L180
Fix proposed to branch: master /review. opendev. org/c/openstack /oslo.concurren cy/+/835111
Review: https:/