diff --git a/etc/nova/nova-config-generator.conf b/etc/nova/nova-config-generator.conf index 931d8b456d4e..090caedabbf4 100644 --- a/etc/nova/nova-config-generator.conf +++ b/etc/nova/nova-config-generator.conf @@ -7,7 +7,6 @@ namespace = nova.api namespace = nova.cells namespace = nova.compute namespace = nova.network -namespace = oslo.cache namespace = oslo.log namespace = oslo.messaging namespace = oslo.policy diff --git a/nova/cache_utils.py b/nova/cache_utils.py index a4eb02f41d6b..bc0851c4cb7b 100644 --- a/nova/cache_utils.py +++ b/nova/cache_utils.py @@ -17,12 +17,12 @@ """Super simple fake memcache client.""" from oslo_cache import core as cache -from oslo_config import cfg +import nova.conf from nova.i18n import _ -CONF = cfg.CONF +CONF = nova.conf.CONF WEEK = 604800 diff --git a/nova/conf/__init__.py b/nova/conf/__init__.py index 416d64779087..cc47da8a70c9 100644 --- a/nova/conf/__init__.py +++ b/nova/conf/__init__.py @@ -25,6 +25,7 @@ from nova.conf import availability_zone # from nova.conf import aws from nova.conf import barbican from nova.conf import base +from nova.conf import cache from nova.conf import cells from nova.conf import cert from nova.conf import cinder @@ -97,6 +98,7 @@ availability_zone.register_opts(CONF) # aws.register_opts(CONF) barbican.register_opts(CONF) base.register_opts(CONF) +cache.register_opts(CONF) cells.register_opts(CONF) cert.register_opts(CONF) cinder.register_opts(CONF) diff --git a/nova/conf/cache.py b/nova/conf/cache.py new file mode 100644 index 000000000000..cccabf7d7d96 --- /dev/null +++ b/nova/conf/cache.py @@ -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() diff --git a/nova/config.py b/nova/config.py index ff25628c6e72..ed637a453e43 100644 --- a/nova/config.py +++ b/nova/config.py @@ -15,7 +15,6 @@ # License for the specific language governing permissions and limitations # under the License. -from oslo_cache import core as cache from oslo_db import options 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, sqlite_db='nova.sqlite') rpc.set_defaults(control_exchange='nova') - cache.configure(CONF) config.set_middleware_defaults() CONF(argv[1:],