diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | oslo/db/options.py | 49 | ||||
-rw-r--r-- | oslo/db/sqlalchemy/utils.py | 2 | ||||
-rw-r--r-- | tests/sqlalchemy/test_migration_common.py | 5 |
4 files changed, 31 insertions, 26 deletions
@@ -18,3 +18,4 @@ ChangeLog .testrepository/ .project .pydevproject +oslo.db.egg-info/ diff --git a/oslo/db/options.py b/oslo/db/options.py index f60f470..45a74bb 100644 --- a/oslo/db/options.py +++ b/oslo/db/options.py @@ -19,19 +19,19 @@ database_opts = [ cfg.StrOpt('sqlite_db', deprecated_group='DEFAULT', default='oslo.sqlite', - help='The file name to use with SQLite'), + help='The file name to use with SQLite.'), cfg.BoolOpt('sqlite_synchronous', deprecated_group='DEFAULT', default=True, - help='If True, SQLite uses synchronous mode'), + help='If True, SQLite uses synchronous mode.'), cfg.StrOpt('backend', default='sqlalchemy', deprecated_name='db_backend', deprecated_group='DEFAULT', - help='The backend to use for db'), + help='The back end to use for the database.'), cfg.StrOpt('connection', - help='The SQLAlchemy connection string used to connect to the ' - 'database', + help='The SQLAlchemy connection string to use to connect to ' + 'the database.', secret=True, deprecated_opts=[cfg.DeprecatedOpt('sql_connection', group='DEFAULT'), @@ -54,7 +54,7 @@ database_opts = [ group='DATABASE'), cfg.DeprecatedOpt('idle_timeout', group='sql')], - help='Timeout before idle sql connections are reaped'), + help='Timeout before idle SQL connections are reaped.'), cfg.IntOpt('min_pool_size', default=1, deprecated_opts=[cfg.DeprecatedOpt('sql_min_pool_size', @@ -62,7 +62,7 @@ database_opts = [ cfg.DeprecatedOpt('sql_min_pool_size', group='DATABASE')], help='Minimum number of SQL connections to keep open in a ' - 'pool'), + 'pool.'), cfg.IntOpt('max_pool_size', default=None, deprecated_opts=[cfg.DeprecatedOpt('sql_max_pool_size', @@ -70,7 +70,7 @@ database_opts = [ cfg.DeprecatedOpt('sql_max_pool_size', group='DATABASE')], help='Maximum number of SQL connections to keep open in a ' - 'pool'), + 'pool.'), cfg.IntOpt('max_retries', default=10, deprecated_opts=[cfg.DeprecatedOpt('sql_max_retries', @@ -78,56 +78,59 @@ database_opts = [ cfg.DeprecatedOpt('sql_max_retries', group='DATABASE')], help='Maximum db connection retries during startup. ' - '(setting -1 implies an infinite retry count)'), + 'Set to -1 to specify an infinite retry count.'), cfg.IntOpt('retry_interval', default=10, deprecated_opts=[cfg.DeprecatedOpt('sql_retry_interval', group='DEFAULT'), cfg.DeprecatedOpt('reconnect_interval', group='DATABASE')], - help='Interval between retries of opening a sql connection'), + help='Interval between retries of opening a SQL connection.'), cfg.IntOpt('max_overflow', default=None, deprecated_opts=[cfg.DeprecatedOpt('sql_max_overflow', group='DEFAULT'), cfg.DeprecatedOpt('sqlalchemy_max_overflow', group='DATABASE')], - help='If set, use this value for max_overflow with sqlalchemy'), + help='If set, use this value for max_overflow with ' + 'SQLAlchemy.'), cfg.IntOpt('connection_debug', default=0, deprecated_opts=[cfg.DeprecatedOpt('sql_connection_debug', group='DEFAULT')], - help='Verbosity of SQL debugging information. 0=None, ' - '100=Everything'), + help='Verbosity of SQL debugging information: 0=None, ' + '100=Everything.'), cfg.BoolOpt('connection_trace', default=False, deprecated_opts=[cfg.DeprecatedOpt('sql_connection_trace', group='DEFAULT')], - help='Add python stack traces to SQL as comment strings'), + help='Add Python stack traces to SQL as comment strings.'), cfg.IntOpt('pool_timeout', default=None, deprecated_opts=[cfg.DeprecatedOpt('sqlalchemy_pool_timeout', group='DATABASE')], - help='If set, use this value for pool_timeout with sqlalchemy'), + help='If set, use this value for pool_timeout with ' + 'SQLAlchemy.'), cfg.BoolOpt('use_db_reconnect', default=False, help='Enable the experimental use of database reconnect ' - 'on connection lost'), + 'on connection lost.'), cfg.IntOpt('db_retry_interval', default=1, - help='seconds between db connection retries'), + help='Seconds between database connection retries.'), cfg.BoolOpt('db_inc_retry_interval', default=True, - help='Whether to increase interval between db connection ' - 'retries, up to db_max_retry_interval'), + help='If True, increases the interval between database ' + 'connection retries up to db_max_retry_interval.'), cfg.IntOpt('db_max_retry_interval', default=10, - help='max seconds between db connection retries, if ' - 'db_inc_retry_interval is enabled'), + help='If db_inc_retry_interval is set, the ' + 'maximum seconds between database connection retries.'), cfg.IntOpt('db_max_retries', default=20, - help='maximum db connection retries before error is raised. ' - '(setting -1 implies an infinite retry count)'), + help='Maximum database connection retries before error is ' + 'raised. Set to -1 to specify an infinite retry ' + 'count.'), ] CONF = cfg.CONF diff --git a/oslo/db/sqlalchemy/utils.py b/oslo/db/sqlalchemy/utils.py index a71305d..fc9f64c 100644 --- a/oslo/db/sqlalchemy/utils.py +++ b/oslo/db/sqlalchemy/utils.py @@ -293,7 +293,7 @@ def _get_not_supported_column(col_name_col_instance, column_name): except KeyError: msg = _("Please specify column %s in col_name_col_instance " "param. It is required because column has unsupported " - "type by sqlite).") + "type by SQLite.") raise ColumnError(msg % column_name) if not isinstance(column, Column): diff --git a/tests/sqlalchemy/test_migration_common.py b/tests/sqlalchemy/test_migration_common.py index d61e732..155c20c 100644 --- a/tests/sqlalchemy/test_migration_common.py +++ b/tests/sqlalchemy/test_migration_common.py @@ -184,9 +184,10 @@ class TestMigrationCommon(test_base.DbTestCase): ) as (mock_find_repo, mock_sanity, mock_downgrade): mock_find_repo.return_value = self.return_value - migration.db_sync(self.engine, self.path, self.test_version, False) + migration.db_sync(self.engine, self.path, self.test_version, + sanity_check=False) - mock_sanity.assert_not_called() + self.assertFalse(mock_sanity.called) def test_db_sanity_table_not_utf8(self): with mock.patch.object(self, 'engine') as mock_eng: |