config options: Centralise 'monkeypatch' options
Add options from 'monkeypatch'. These options affect the entire system so they have been included in the "nova.conf.base" file. Change-Id: Ic85107b33e414f05984d10f2cb9b74829ab3219d Implements: bp centralize-config-options-newton
This commit is contained in:
parent
f3a90a97b2
commit
9f92a6a7bb
@ -46,12 +46,29 @@ tempdir = cfg.StrOpt(
|
|||||||
'tempdir',
|
'tempdir',
|
||||||
help='Explicitly specify the temporary working directory')
|
help='Explicitly specify the temporary working directory')
|
||||||
|
|
||||||
|
monkey_patch = cfg.BoolOpt(
|
||||||
|
'monkey_patch',
|
||||||
|
default=False,
|
||||||
|
help='Whether to apply monkey patching')
|
||||||
|
|
||||||
|
notify_decorator = 'nova.notifications.notify_decorator'
|
||||||
|
|
||||||
|
monkey_patch_modules = cfg.ListOpt(
|
||||||
|
'monkey_patch_modules',
|
||||||
|
default=[
|
||||||
|
'nova.compute.api:%s' % (notify_decorator)
|
||||||
|
],
|
||||||
|
help='List of modules/decorators to monkey patch')
|
||||||
|
|
||||||
|
|
||||||
ALL_OPTS = [
|
ALL_OPTS = [
|
||||||
password_length,
|
password_length,
|
||||||
instance_usage_audit_period,
|
instance_usage_audit_period,
|
||||||
use_rootwrap_daemon,
|
use_rootwrap_daemon,
|
||||||
rootwrap_config,
|
rootwrap_config,
|
||||||
tempdir]
|
tempdir,
|
||||||
|
monkey_patch,
|
||||||
|
monkey_patch_modules]
|
||||||
|
|
||||||
|
|
||||||
def register_opts(conf):
|
def register_opts(conf):
|
||||||
|
@ -38,7 +38,6 @@ import nova.paths
|
|||||||
import nova.quota
|
import nova.quota
|
||||||
import nova.servicegroup.api
|
import nova.servicegroup.api
|
||||||
import nova.spice
|
import nova.spice
|
||||||
import nova.utils
|
|
||||||
import nova.volume
|
import nova.volume
|
||||||
import nova.volume.cinder
|
import nova.volume.cinder
|
||||||
|
|
||||||
@ -63,7 +62,6 @@ def list_opts():
|
|||||||
nova.notifications.notify_opts,
|
nova.notifications.notify_opts,
|
||||||
nova.paths.path_opts,
|
nova.paths.path_opts,
|
||||||
nova.quota.quota_opts,
|
nova.quota.quota_opts,
|
||||||
nova.utils.monkey_patch_opts,
|
|
||||||
nova.volume._volume_opts,
|
nova.volume._volume_opts,
|
||||||
)),
|
)),
|
||||||
('cinder', nova.volume.cinder.cinder_opts),
|
('cinder', nova.volume.cinder.cinder_opts),
|
||||||
|
@ -42,7 +42,6 @@ import eventlet
|
|||||||
import netaddr
|
import netaddr
|
||||||
from oslo_concurrency import lockutils
|
from oslo_concurrency import lockutils
|
||||||
from oslo_concurrency import processutils
|
from oslo_concurrency import processutils
|
||||||
from oslo_config import cfg
|
|
||||||
from oslo_context import context as common_context
|
from oslo_context import context as common_context
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import oslo_messaging as messaging
|
||||||
@ -62,22 +61,8 @@ from nova.i18n import _, _LE, _LI, _LW
|
|||||||
import nova.network
|
import nova.network
|
||||||
from nova import safe_utils
|
from nova import safe_utils
|
||||||
|
|
||||||
notify_decorator = 'nova.notifications.notify_decorator'
|
|
||||||
|
|
||||||
monkey_patch_opts = [
|
|
||||||
cfg.BoolOpt('monkey_patch',
|
|
||||||
default=False,
|
|
||||||
help='Whether to apply monkey patching'),
|
|
||||||
cfg.ListOpt('monkey_patch_modules',
|
|
||||||
default=[
|
|
||||||
'nova.compute.api:%s' % (notify_decorator)
|
|
||||||
],
|
|
||||||
help='List of modules/decorators to monkey patch'),
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
CONF = nova.conf.CONF
|
CONF = nova.conf.CONF
|
||||||
CONF.register_opts(monkey_patch_opts)
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user