summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-07-12 13:33:23 +0000
committerGerrit Code Review <review@openstack.org>2016-07-12 13:33:23 +0000
commit6e814373c793071db546ca7508c07b33203e2825 (patch)
treea50169e1e485447deb8a63d8e1a454ef9b316a27
parentfc3c23a722c8726504657cb8fd96a6b14146ee93 (diff)
parente0cc306c0a581b84d0a8b9eddfcd77ebf50977e7 (diff)
downloadoslo-db-6e814373c793071db546ca7508c07b33203e2825.tar.gz
Merge "Set a min and max on the connection_debug option"
-rw-r--r--oslo_db/options.py1
-rw-r--r--oslo_db/sqlalchemy/engines.py2
-rw-r--r--releasenotes/notes/connection_debug_min_max-bf6d53d49be7ca52.yaml7
3 files changed, 9 insertions, 1 deletions
diff --git a/oslo_db/options.py b/oslo_db/options.py
index 89f4cf7..7742686 100644
--- a/oslo_db/options.py
+++ b/oslo_db/options.py
@@ -101,6 +101,7 @@ database_opts = [
'SQLAlchemy.'),
cfg.IntOpt('connection_debug',
default=0,
+ min=0, max=100,
deprecated_opts=[cfg.DeprecatedOpt('sql_connection_debug',
group='DEFAULT')],
help='Verbosity of SQL debugging information: 0=None, '
diff --git a/oslo_db/sqlalchemy/engines.py b/oslo_db/sqlalchemy/engines.py
index 54852b4..3e8bb0a 100644
--- a/oslo_db/sqlalchemy/engines.py
+++ b/oslo_db/sqlalchemy/engines.py
@@ -93,7 +93,7 @@ def _setup_logging(connection_debug=0):
"""
if connection_debug >= 0:
logger = logging.getLogger('sqlalchemy.engine')
- if connection_debug >= 100:
+ if connection_debug == 100:
logger.setLevel(logging.DEBUG)
elif connection_debug >= 50:
logger.setLevel(logging.INFO)
diff --git a/releasenotes/notes/connection_debug_min_max-bf6d53d49be7ca52.yaml b/releasenotes/notes/connection_debug_min_max-bf6d53d49be7ca52.yaml
new file mode 100644
index 0000000..7b0713b
--- /dev/null
+++ b/releasenotes/notes/connection_debug_min_max-bf6d53d49be7ca52.yaml
@@ -0,0 +1,7 @@
+---
+upgrade:
+ - The allowed values for the ``connection_debug`` option are now restricted to
+ the range between 0 and 100 (inclusive). Previously a number lower than 0
+ or higher than 100 could be given without error. But now, a
+ ``ConfigFileValueError`` will be raised when the option value is outside this
+ range.