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:
Stephen Finucane 2016-03-29 15:10:21 +01:00
parent 5d5d65174e
commit 58530e1bba
2 changed files with 18 additions and 16 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

@ -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__)