Fix missing instance_ports_cache options

Also remove skipsdist to fix genconfig target in tox.

Change-Id: I4320c98bd0cd20b4192caa5de32b0e79f097ccb1
This commit is contained in:
Takashi Kajinami 2025-01-12 15:49:25 +09:00
parent 9c92df8152
commit 6a016ff447
3 changed files with 18 additions and 15 deletions

View File

@ -1,7 +1,6 @@
[tox]
envlist = py3,pep8,cover,api-ref,releasenotes,bandit,fakemodetests
minversion = 3.18.0
skipsdist = True
[testenv]
setenv = VIRTUAL_ENV={envdir}

View File

@ -18,6 +18,20 @@ from oslo_cache import core
from oslo_config import cfg
PORTS_CACHE_GROUP = cfg.OptGroup('instance_ports_cache')
PORTS_CACHE_OPTS = [
cfg.IntOpt('expiration_time', default=86400,
help='TTL, in seconds, for any cached item in the '
'dogpile.cache region used for caching of the '
'instance ports.'),
cfg.BoolOpt("caching", default=True,
help='Toggle to enable/disable caching when getting trove '
'instance ports. Please note that the global toggle '
'for oslo.cache(enabled=True in [cache] group) '
'must be enabled to use this feature.')
]
def register_cache_configurations(conf):
"""Register all configurations required for oslo.cache.
@ -26,20 +40,8 @@ def register_cache_configurations(conf):
"""
core.configure(conf)
ports_cache_group = cfg.OptGroup('instance_ports_cache')
ports_cache_opts = [
cfg.IntOpt('expiration_time', default=86400,
help='TTL, in seconds, for any cached item in the '
'dogpile.cache region used for caching of the '
'instance ports.'),
cfg.BoolOpt("caching", default=True,
help='Toggle to enable/disable caching when getting trove '
'instance ports. Please note that the global toggle '
'for oslo.cache(enabled=True in [cache] group) '
'must be enabled to use this feature.')
]
conf.register_group(ports_cache_group)
conf.register_opts(ports_cache_opts, group=ports_cache_group)
conf.register_group(PORTS_CACHE_GROUP)
conf.register_opts(PORTS_CACHE_OPTS, group=PORTS_CACHE_GROUP)
return conf

View File

@ -28,6 +28,7 @@ from oslo_log import versionutils
from oslo_middleware import cors
from osprofiler import opts as profiler
from trove.common import cache
from trove.common.i18n import _
from trove.version import version_info as version
@ -1611,6 +1612,7 @@ def list_opts():
(network_group, network_opts),
(service_credentials_group, service_credentials_opts),
(guest_agent_group, guest_agent_opts),
(cache.PORTS_CACHE_GROUP, cache.PORTS_CACHE_OPTS)
]
return keystone_middleware_opts + keystone_loading_opts + trove_opts