Fix duplicate declarations for db_backend_package

The package resource in the oslo::db define uses the fixed name
db_backend_package. This is a bad idea because it causes
'duplicate definition' errors on deployments using multiple database
backends that require a package install (like mysql and mongodb).

In stead, just use the actual package name. This prevents duplicate
definitions.

Change-Id: I03a5741865a7519506cbd9f567a24ff42e27f39a
Signed-off-by: Tom Verdaat <tom@server.biz>
This commit is contained in:
Tom Verdaat 2017-05-24 12:48:54 +02:00
parent a1f706d73f
commit 462f0ee137
2 changed files with 4 additions and 6 deletions

View File

@ -161,7 +161,7 @@ define oslo::db(
}
if $backend_package and !defined(Package[$backend_package]) {
package { 'db_backend_package':
package { $backend_package:
ensure => $backend_package_ensure,
name => $backend_package,
tag => 'openstack',

View File

@ -83,7 +83,7 @@ describe 'oslo::db' do
end
it 'install the proper backend package' do
is_expected.to contain_package('db_backend_package').with(
is_expected.to contain_package('python-pymongo').with(
:ensure => 'present',
:name => 'python-pymongo',
:tag => 'openstack'
@ -143,7 +143,7 @@ describe 'oslo::db' do
end
it 'install the proper backend package' do
is_expected.to contain_package('db_backend_package').with(
is_expected.to contain_package('python-pymysql').with(
:ensure => 'present',
:name => 'python-pymysql',
:tag => 'openstack'
@ -157,7 +157,7 @@ describe 'oslo::db' do
end
it 'install the proper backend package' do
is_expected.to contain_package('db_backend_package').with(
is_expected.to contain_package('python-pysqlite2').with(
:ensure => 'present',
:name => 'python-pysqlite2',
:tag => 'openstack'
@ -171,8 +171,6 @@ describe 'oslo::db' do
let :params do
{ :connection => 'mysql+pymysql:///db:db@localhost/db', }
end
it { is_expected.not_to contain_package('db_backend_package') }
end
end