summaryrefslogtreecommitdiffstats
path: root/openstack/common/db/api.py
diff options
context:
space:
mode:
authorDavanum Srinivas <dims@linux.vnet.ibm.com>2013-04-23 09:54:22 -0400
committerDavanum Srinivas <dims@linux.vnet.ibm.com>2013-05-20 21:05:22 -0400
commit4ff33b0390fff7e623be7c2242002e32a47eb855 (patch)
tree5b126191bc62466fa1f55768b2dc1f345172a39a /openstack/common/db/api.py
parent97bb81ddbcc47343c78e0a6efe724878fcb35ecb (diff)
downloadoslo-4ff33b0390fff7e623be7c2242002e32a47eb855.tar.gz
oslo-4ff33b0390fff7e623be7c2242002e32a47eb855.tar.xz
oslo-4ff33b0390fff7e623be7c2242002e32a47eb855.zip
Specify database group instead of DEFAULT
At the request of Quantum folks, Let us switch from DEFAULT to database for the database related options. This will help with migration etc. DocImpact Fixes LP# 1171837 Change-Id: If602a6a7cc0f2a202632dd14574fea60dce4b589
Diffstat (limited to 'openstack/common/db/api.py')
-rw-r--r--openstack/common/db/api.py19
1 files changed, 12 insertions, 7 deletions
diff --git a/openstack/common/db/api.py b/openstack/common/db/api.py
index 5603bb5..dcadecd 100644
--- a/openstack/common/db/api.py
+++ b/openstack/common/db/api.py
@@ -19,8 +19,9 @@
Supported configuration options:
-`db_backend`: DB backend name or full module path to DB backend module.
-`dbapi_use_tpool`: Enable thread pooling of DB API calls.
+The following two parameters are in the 'database' group:
+`backend`: DB backend name or full module path to DB backend module.
+`use_tpool`: Enable thread pooling of DB API calls.
A DB backend module should implement a method named 'get_backend' which
takes no arguments. The method can return any object that implements DB
@@ -44,17 +45,21 @@ from openstack.common import lockutils
db_opts = [
- cfg.StrOpt('db_backend',
+ cfg.StrOpt('backend',
default='sqlalchemy',
+ deprecated_name='db_backend',
+ deprecated_group='DEFAULT',
help='The backend to use for db'),
- cfg.BoolOpt('dbapi_use_tpool',
+ cfg.BoolOpt('use_tpool',
default=False,
+ deprecated_name='dbapi_use_tpool',
+ deprecated_group='DEFAULT',
help='Enable the experimental use of thread pooling for '
'all DB API calls')
]
CONF = cfg.CONF
-CONF.register_opts(db_opts)
+CONF.register_opts(db_opts, 'database')
class DBAPI(object):
@@ -75,8 +80,8 @@ class DBAPI(object):
if self.__backend:
# Another thread assigned it
return self.__backend
- backend_name = CONF.db_backend
- self.__use_tpool = CONF.dbapi_use_tpool
+ backend_name = CONF.database.backend
+ self.__use_tpool = CONF.database.use_tpool
if self.__use_tpool:
from eventlet import tpool
self.__tpool = tpool