Merge pull request #131 from branan/parameterize_db_charset
Parameterize the nova db charset
This commit is contained in:
commit
beb2ce118b
|
@ -10,6 +10,8 @@ class nova::db::mysql(
|
|||
$cluster_id = 'localzone'
|
||||
) {
|
||||
|
||||
include 'nova::params'
|
||||
|
||||
require 'mysql::python'
|
||||
# Create the db instance before openstack-nova if its installed
|
||||
Mysql::Db[$dbname] -> Anchor<| title == "nova-start" |>
|
||||
|
@ -19,6 +21,7 @@ class nova::db::mysql(
|
|||
user => $user,
|
||||
password => $password,
|
||||
host => $host,
|
||||
charset => $nova::params::nova_db_charset,
|
||||
# I may want to inject some sql
|
||||
require => Class['mysql::config'],
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ class nova::params {
|
|||
# redhat specific config defaults
|
||||
$root_helper = 'sudo nova-rootwrap'
|
||||
$lock_path = '/var/lib/nova/tmp'
|
||||
$nova_db_charset = 'latin1'
|
||||
}
|
||||
'Debian': {
|
||||
# package names
|
||||
|
@ -66,6 +67,7 @@ class nova::params {
|
|||
# debian specific nova config
|
||||
$root_helper = 'sudo nova-rootwrap'
|
||||
$lock_path = '/var/lock/nova'
|
||||
$nova_db_charset = 'utf8'
|
||||
case $::operatingsystem {
|
||||
'Debian': {
|
||||
$consoleauth_package_name = 'nova-console'
|
||||
|
|
|
@ -1,16 +1,34 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'nova::db::mysql' do
|
||||
let :facts do
|
||||
{ :osfamily => "Debian" }
|
||||
end
|
||||
let :params do
|
||||
{ :password => "qwerty" }
|
||||
end
|
||||
it { should contain_mysql__db('nova').with(
|
||||
|
||||
context 'on a Debian osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => "Debian" }
|
||||
end
|
||||
let :params do
|
||||
{ :password => "qwerty" }
|
||||
end
|
||||
it { should contain_mysql__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'qwerty',
|
||||
:charset => 'utf8',
|
||||
:require => "Class[Mysql::Config]"
|
||||
)}
|
||||
)}
|
||||
end
|
||||
|
||||
context 'on a RedHat osfamily' do
|
||||
let :facts do
|
||||
{ :osfamily => 'RedHat' }
|
||||
end
|
||||
let :params do
|
||||
{ :password => 'qwerty' }
|
||||
end
|
||||
it { should contain_mysql__db('nova').with(
|
||||
:user => 'nova',
|
||||
:password => 'qwerty',
|
||||
:charset => 'latin1',
|
||||
:require => "Class[Mysql::Config]"
|
||||
)}
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue