Support os-brick specific lock_path

Note: Initially this patch was related to new feature, but now it has
become a bug since os-brick's `setup` method is not being called and it
can create problems if os-brick changes.

As a new feature, os-brick now supports setting the location of file
locks in a different location from the locks of the service.

The functionality is intended for HCI deployments and hosts that are
running Cinder and Glance using Cinder backend.  In those scenarios the
service can use a service specific location for its file locks while
only sharing the location of os-brick with the other services.

To leverage this functionality the new os-brick code is needed and
method ``os_brick.setup`` needs to be called once the service
configuration options have been loaded.

The default value of the os-brick ``lock_path`` is the one set in
``oslo_concurrency``.

This patch adds support for this new feature in a non backward
compatible way, so it requires an os-brick version bump in the
requirements.

The patch also ensures that ``tox -egenconfig`` includes the os-brick
configuration options when generating the sample config.

Closes-Bug: #2081859
Change-Id: I1b81eb65bd145869e8cf6f3aabc6ade58f832a19
This commit is contained in:
Gorka Eguileor 2022-07-07 16:22:42 +02:00
parent 6fb1997def
commit 8c1a47c9cf
4 changed files with 11 additions and 1 deletions

View File

@ -18,3 +18,4 @@ namespace = oslo.versionedobjects
namespace = keystonemiddleware.auth_token
namespace = osprofiler
namespace = os_vif
namespace = os_brick

View File

@ -19,6 +19,7 @@
import shlex
import sys
import os_brick
import os_vif
from oslo_log import log as logging
from oslo_privsep import priv_context
@ -47,6 +48,7 @@ def main():
priv_context.init(root_helper=shlex.split(utils.get_root_helper()))
objects.register_all()
gmr_opts.set_defaults(CONF)
os_brick.setup(CONF)
# Ensure os-vif objects are registered and plugins loaded
os_vif.initialize()

View File

@ -0,0 +1,7 @@
---
features:
- |
On HCI deployments where Nova is collocated with the Cinder service or the
Glance using Cinder backend service, an os-brick shared location can be
configured using the ``lock_path`` in the ``[os_brick]`` configuration
section.

View File

@ -50,7 +50,7 @@ rfc3986>=1.2.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0
psutil>=3.2.2 # BSD
oslo.versionedobjects>=1.35.0 # Apache-2.0
os-brick>=5.2 # Apache-2.0
os-brick>=6.0 # Apache-2.0
os-resource-classes>=1.1.0 # Apache-2.0
os-traits>=3.1.0 # Apache-2.0
os-vif>=3.1.0 # Apache-2.0