Config options: centralize cache options

The config options of the "nova.conf" section "cache" got
moved to the new central location "nova/conf/cache.py".

Change-Id: I1b7aebb9f7d44ff8312b98c88093bf01f44dfa58
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Hieu LE
2016-05-12 12:29:20 +07:00
parent 505bc44615
commit 466bce576a
5 changed files with 30 additions and 5 deletions
-1
View File
@@ -7,7 +7,6 @@ namespace = nova.api
namespace = nova.cells namespace = nova.cells
namespace = nova.compute namespace = nova.compute
namespace = nova.network namespace = nova.network
namespace = oslo.cache
namespace = oslo.log namespace = oslo.log
namespace = oslo.messaging namespace = oslo.messaging
namespace = oslo.policy namespace = oslo.policy
+2 -2
View File
@@ -17,12 +17,12 @@
"""Super simple fake memcache client.""" """Super simple fake memcache client."""
from oslo_cache import core as cache from oslo_cache import core as cache
from oslo_config import cfg
import nova.conf
from nova.i18n import _ from nova.i18n import _
CONF = cfg.CONF CONF = nova.conf.CONF
WEEK = 604800 WEEK = 604800
+2
View File
@@ -25,6 +25,7 @@ from nova.conf import availability_zone
# from nova.conf import aws # from nova.conf import aws
from nova.conf import barbican from nova.conf import barbican
from nova.conf import base from nova.conf import base
from nova.conf import cache
from nova.conf import cells from nova.conf import cells
from nova.conf import cert from nova.conf import cert
from nova.conf import cinder from nova.conf import cinder
@@ -97,6 +98,7 @@ availability_zone.register_opts(CONF)
# aws.register_opts(CONF) # aws.register_opts(CONF)
barbican.register_opts(CONF) barbican.register_opts(CONF)
base.register_opts(CONF) base.register_opts(CONF)
cache.register_opts(CONF)
cells.register_opts(CONF) cells.register_opts(CONF)
cert.register_opts(CONF) cert.register_opts(CONF)
cinder.register_opts(CONF) cinder.register_opts(CONF)
+26
View File
@@ -0,0 +1,26 @@
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2016 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
from oslo_cache import core
def register_opts(conf):
core.configure(conf)
def list_opts():
return core._opts.list_opts()
-2
View File
@@ -15,7 +15,6 @@
# License for the specific language governing permissions and limitations # License for the specific language governing permissions and limitations
# under the License. # under the License.
from oslo_cache import core as cache
from oslo_db import options from oslo_db import options
from oslo_log import log from oslo_log import log
@@ -44,7 +43,6 @@ def parse_args(argv, default_config_files=None, configure_db=True,
options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION, options.set_defaults(CONF, connection=_DEFAULT_SQL_CONNECTION,
sqlite_db='nova.sqlite') sqlite_db='nova.sqlite')
rpc.set_defaults(control_exchange='nova') rpc.set_defaults(control_exchange='nova')
cache.configure(CONF)
config.set_middleware_defaults() config.set_middleware_defaults()
CONF(argv[1:], CONF(argv[1:],