Merge "config options: Centralise 'monkeypatch' options"

This commit is contained in:
Jenkins 2016-04-05 13:03:32 +00:00 committed by Gerrit Code Review
commit 053c196008
3 changed files with 18 additions and 18 deletions

View File

@ -46,12 +46,29 @@ tempdir = cfg.StrOpt(
'tempdir',
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 = [
password_length,
instance_usage_audit_period,
use_rootwrap_daemon,
rootwrap_config,
tempdir]
tempdir,
monkey_patch,
monkey_patch_modules]
def register_opts(conf):

View File

@ -38,7 +38,6 @@ import nova.paths
import nova.quota
import nova.servicegroup.api
import nova.spice
import nova.utils
import nova.volume
import nova.volume.cinder
@ -63,7 +62,6 @@ def list_opts():
nova.notifications.notify_opts,
nova.paths.path_opts,
nova.quota.quota_opts,
nova.utils.monkey_patch_opts,
nova.volume._volume_opts,
)),
('cinder', nova.volume.cinder.cinder_opts),

View File

@ -42,7 +42,6 @@ import eventlet
import netaddr
from oslo_concurrency import lockutils
from oslo_concurrency import processutils
from oslo_config import cfg
from oslo_context import context as common_context
from oslo_log import log as logging
import oslo_messaging as messaging
@ -62,22 +61,8 @@ from nova.i18n import _, _LE, _LI, _LW
import nova.network
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.register_opts(monkey_patch_opts)
LOG = logging.getLogger(__name__)