Config options: move set default opt of db section to centralized place

Currently markus_z have centralized database section in
nova/conf/database.py. But in nova/config.py, there is a
part of database section that set the default options of
oslo_db. The set_default_opt include register_opt and should be
moved to centralized place.

Change-Id: Ic94991b009dfaa076a5f285b43018e473e9e074f
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Hieu LE 2016-05-18 12:54:17 +07:00
parent fbfd733d6d
commit 1e798ee58d

View File

@ -13,10 +13,13 @@
# License for the specific language governing permissions and limitations
# under the License.
from nova.conf import paths
from oslo_config import cfg
from oslo_db import options as oslo_db_options
_DEFAULT_SQL_CONNECTION = 'sqlite:///' + paths.state_path_def('nova.sqlite')
# NOTE(sdague): we know of at least 1 instance of out of tree usage
# for this config in RAX. They used this because of performance issues
@ -87,7 +90,8 @@ api_db_opts = [
def register_opts(conf):
conf.register_opts(oslo_db_options.database_opts, 'database')
oslo_db_options.set_defaults(conf, connection=_DEFAULT_SQL_CONNECTION,
sqlite_db='nova.sqlite')
conf.register_opt(db_driver_opt)
conf.register_opts(api_db_opts, group='api_database')