Unifies plugin configuration groups
There were plugins that didn't use "benchamrk" section now they use "openstack" section Change-Id: I565d470cbcff1fc7bd717f0632c7d0518c06c0ed
This commit is contained in:
parent
e9539a16fe
commit
4f955b08ec
@ -15,9 +15,13 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
OPTS = {"cleanup": [
|
||||
cfg.IntOpt("resource_deletion_timeout", default=600,
|
||||
OPTS = {"openstack": [
|
||||
cfg.IntOpt("resource_deletion_timeout",
|
||||
default=600,
|
||||
deprecated_group="cleanup",
|
||||
help="A timeout in seconds for deleting resources"),
|
||||
cfg.IntOpt("cleanup_threads", default=20,
|
||||
cfg.IntOpt("cleanup_threads",
|
||||
default=20,
|
||||
deprecated_group="cleanup",
|
||||
help="Number of cleanup threads to run")
|
||||
]}
|
||||
|
@ -15,9 +15,11 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
OPTS = {"roles_context": [
|
||||
cfg.IntOpt("resource_management_workers",
|
||||
OPTS = {"openstack": [
|
||||
cfg.IntOpt("roles_context_resource_management_workers",
|
||||
default=30,
|
||||
deprecated_name="resource_management_workers",
|
||||
deprecated_group="roles_context",
|
||||
help="How many concurrent threads to use for serving roles "
|
||||
"context"),
|
||||
]}
|
||||
|
@ -15,23 +15,25 @@
|
||||
|
||||
from oslo_config import cfg
|
||||
|
||||
RESOURCE_MANAGEMENT_WORKERS_DESCR = ("The number of concurrent threads to use "
|
||||
"for serving users context.")
|
||||
PROJECT_DOMAIN_DESCR = "ID of domain in which projects will be created."
|
||||
USER_DOMAIN_DESCR = "ID of domain in which users will be created."
|
||||
|
||||
OPTS = {"users_context": [
|
||||
cfg.IntOpt("resource_management_workers",
|
||||
OPTS = {"openstack": [
|
||||
cfg.IntOpt("users_context_resource_management_workers",
|
||||
default=20,
|
||||
help=RESOURCE_MANAGEMENT_WORKERS_DESCR),
|
||||
deprecated_name="resource_management_workers",
|
||||
deprecated_group="users_context",
|
||||
help="The number of concurrent threads to use for serving "
|
||||
"users context."),
|
||||
cfg.StrOpt("project_domain",
|
||||
default="default",
|
||||
help=PROJECT_DOMAIN_DESCR),
|
||||
deprecated_group="users_context",
|
||||
help="ID of domain in which projects will be created."),
|
||||
cfg.StrOpt("user_domain",
|
||||
default="default",
|
||||
help=USER_DOMAIN_DESCR),
|
||||
deprecated_group="users_context",
|
||||
help="ID of domain in which users will be created."),
|
||||
cfg.StrOpt("keystone_default_role",
|
||||
default="member",
|
||||
deprecated_group="users_context",
|
||||
help="The default role name of the keystone to assign to "
|
||||
"users."),
|
||||
"users.")
|
||||
]}
|
||||
|
@ -41,8 +41,8 @@ class NoName(object):
|
||||
|
||||
def resource(service, resource, order=0, admin_required=False,
|
||||
perform_for_admin_only=False, tenant_resource=False,
|
||||
max_attempts=3, timeout=CONF.cleanup.resource_deletion_timeout,
|
||||
interval=1, threads=CONF.cleanup.cleanup_threads):
|
||||
max_attempts=3, timeout=CONF.openstack.resource_deletion_timeout,
|
||||
interval=1, threads=CONF.openstack.cleanup_threads):
|
||||
"""Decorator that overrides resource specification.
|
||||
|
||||
Just put it on top of your resource class and specify arguments that you
|
||||
|
@ -47,7 +47,8 @@ class RoleGenerator(context.Context):
|
||||
def __init__(self, ctx):
|
||||
super(RoleGenerator, self).__init__(ctx)
|
||||
self.credential = self.context["admin"]["credential"]
|
||||
self.workers = cfg.CONF.roles_context.resource_management_workers
|
||||
self.workers = (
|
||||
cfg.CONF.openstack.roles_context_resource_management_workers)
|
||||
|
||||
def _get_role_object(self, context_role):
|
||||
"""Check if role exists.
|
||||
|
@ -99,7 +99,7 @@ class UserGenerator(context.Context):
|
||||
"tenants": 1,
|
||||
"users_per_tenant": 1,
|
||||
"resource_management_workers":
|
||||
cfg.CONF.users_context.resource_management_workers,
|
||||
cfg.CONF.openstack.users_context_resource_management_workers,
|
||||
}
|
||||
|
||||
def __init__(self, context):
|
||||
@ -116,9 +116,9 @@ class UserGenerator(context.Context):
|
||||
self.existing_users = []
|
||||
self.credential = context["admin"]["credential"]
|
||||
project_domain = (self.credential.project_domain_name or
|
||||
cfg.CONF.users_context.project_domain)
|
||||
cfg.CONF.openstack.project_domain)
|
||||
user_domain = (self.credential.user_domain_name or
|
||||
cfg.CONF.users_context.user_domain)
|
||||
cfg.CONF.openstack.user_domain)
|
||||
self.DEFAULT_FOR_NEW_USERS["project_domain"] = project_domain
|
||||
self.DEFAULT_FOR_NEW_USERS["user_domain"] = user_domain
|
||||
with self.config.unlocked():
|
||||
@ -181,7 +181,7 @@ class UserGenerator(context.Context):
|
||||
# NOTE(msdubov): This should be called after _create_tenants().
|
||||
threads = self.config["resource_management_workers"]
|
||||
users_per_tenant = self.config["users_per_tenant"]
|
||||
default_role = cfg.CONF.users_context.keystone_default_role
|
||||
default_role = cfg.CONF.openstack.keystone_default_role
|
||||
|
||||
users = collections.deque()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user