Follow-up on PyMySQL support for Red Hat platforms

Rely on packaging dependencies to avoid issues caused by different
package names between Fedora and RHEL (python-PyMySQL vs python2-PyMySQL).

https://review.openstack.org/#/c/245229/4/spec/classes/neutron_db_spec.rb
includes all the discussion that led to this.

Change-Id: Iff047fab81f620f8df5a40296d23203461949546
This commit is contained in:
iberezovskiy 2015-12-02 17:28:27 +03:00
parent 02061e6e7c
commit dd72e6d549
2 changed files with 22 additions and 11 deletions

View File

@ -32,7 +32,7 @@ class keystone::params {
$service_provider = undef
$keystone_wsgi_script_source = '/usr/share/keystone/keystone.wsgi'
$paste_config = '/usr/share/keystone/keystone-dist-paste.ini'
$pymysql_package_name = 'python2-PyMySQL'
$pymysql_package_name = undef
}
}
}

View File

@ -34,8 +34,6 @@ describe 'keystone::db' do
it { is_expected.to contain_keystone_config('database/max_pool_size').with_value('21') }
it { is_expected.to contain_keystone_config('database/max_overflow').with_value('21') }
it { is_expected.to contain_keystone_config('database/retry_interval').with_value('11') }
it { is_expected.to contain_package('keystone-backend-package').with({ :ensure => 'present', :name => platform_params[:pymysql_package_name] }) }
end
context 'with MySQL-python library as backend package' do
@ -83,11 +81,21 @@ describe 'keystone::db' do
})
end
let :platform_params do
{ :pymysql_package_name => 'python-pymysql' }
end
it_configures 'keystone::db'
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://keystone:keystone@localhost/keystone', }
end
it 'install the proper backend package' do
is_expected.to contain_package('keystone-backend-package').with(
:ensure => 'present',
:name => 'python-pymysql',
:tag => 'openstack'
)
end
end
end
context 'on Redhat platforms' do
@ -97,11 +105,14 @@ describe 'keystone::db' do
})
end
let :platform_params do
{ :pymysql_package_name => 'python2-PyMySQL' }
end
it_configures 'keystone::db'
context 'using pymysql driver' do
let :params do
{ :database_connection => 'mysql+pymysql://keystone:keystone@localhost/keystone', }
end
it { is_expected.not_to contain_package('keystone-backend-package') }
end
end
end