Fix mysql connection
URL mysql://scott:***@some_host/some_db does not contain a '+drivername'
portion, and will make use of a default driver. A full dbname+drivername://
protocol is recommended. For MySQL, it is strongly recommended that
mysql+pymysql:// be specified for maximum service compatibility.
Change-Id: I8646f135ca2fa28c1858a900bac21acdadb08401
Closes-Bug: #1753342
(cherry picked from commit c9b4316df4
)
This commit is contained in:
parent
7efabfa220
commit
5f82c24354
|
@ -6,7 +6,7 @@
|
|||
#
|
||||
# [*database_connection*]
|
||||
# (Optional) Url used to connect to database.
|
||||
# Defaults to "mysql://vitrage:secrete@localhost:3306/vitrage".
|
||||
# Defaults to "mysql+pymysql://vitrage:secrete@localhost:3306/vitrage".
|
||||
#
|
||||
# [*database_max_retries*]
|
||||
# (Optional) Maximum number of database connection retries during startup.
|
||||
|
@ -39,7 +39,7 @@
|
|||
# Defaults to $::os_service_default.
|
||||
#
|
||||
class vitrage::db (
|
||||
$database_connection = 'mysql://vitrage:secrete@localhost:3306/vitrage',
|
||||
$database_connection = 'mysql+pymysql://vitrage:secrete@localhost:3306/vitrage',
|
||||
$database_idle_timeout = $::os_service_default,
|
||||
$database_min_pool_size = $::os_service_default,
|
||||
$database_max_pool_size = $::os_service_default,
|
||||
|
|
|
@ -6,7 +6,7 @@ describe 'vitrage::db' do
|
|||
context 'with default parameters' do
|
||||
it { is_expected.to contain_oslo__db('vitrage_config').with(
|
||||
:db_max_retries => '<SERVICE DEFAULT>',
|
||||
:connection => 'mysql://vitrage:secrete@localhost:3306/vitrage',
|
||||
:connection => 'mysql+pymysql://vitrage:secrete@localhost:3306/vitrage',
|
||||
:idle_timeout => '<SERVICE DEFAULT>',
|
||||
:min_pool_size => '<SERVICE DEFAULT>',
|
||||
:max_pool_size => '<SERVICE DEFAULT>',
|
||||
|
@ -54,7 +54,7 @@ describe 'vitrage::db' do
|
|||
|
||||
context 'with MySQL-python library as backend package' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql://vitrage:vitrage@localhost/vitrage', }
|
||||
{ :database_connection => 'mysql+pymysql://vitrage:vitrage@localhost/vitrage', }
|
||||
end
|
||||
|
||||
it { is_expected.to contain_package('python-mysqldb').with(:ensure => 'present') }
|
||||
|
|
Loading…
Reference in New Issue