Inherit pyvers from openstacklib::defaults
Depends-On: I84b767921d151a61429b2c89e6372c4b447f0d7d Change-Id: I4bfaf14e60a4684218afe56ccf2a9ee8318228e4
This commit is contained in:
parent
56b74b7d5d
commit
2487fd2285
|
@ -4,13 +4,7 @@
|
|||
#
|
||||
class barbican::params {
|
||||
include ::openstacklib::defaults
|
||||
|
||||
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
|
||||
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
|
||||
$pyvers = '3'
|
||||
} else {
|
||||
$pyvers = ''
|
||||
}
|
||||
$pyvers = $::openstacklib::defaults::pyvers
|
||||
|
||||
$client_package_name = "python${pyvers}-barbicanclient"
|
||||
$group = 'barbican'
|
||||
|
|
|
@ -59,11 +59,7 @@ describe 'barbican::client' do
|
|||
let(:platform_params) do
|
||||
case facts[:osfamily]
|
||||
when 'Debian'
|
||||
if facts[:os_package_type] == 'debian'
|
||||
{ :client_package_name => 'python3-barbicanclient' }
|
||||
else
|
||||
{ :client_package_name => 'python-barbicanclient' }
|
||||
end
|
||||
{ :client_package_name => 'python3-barbicanclient' }
|
||||
when 'RedHat'
|
||||
{ :client_package_name => 'python-barbicanclient' }
|
||||
end
|
||||
|
|
|
@ -20,11 +20,8 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'barbican::db' do
|
||||
|
||||
shared_examples 'barbican::db' do
|
||||
|
||||
context 'with default parameters' do
|
||||
|
||||
it { is_expected.to contain_oslo__db('barbican_config').with(
|
||||
:db_max_retries => '<SERVICE DEFAULT>',
|
||||
:connection => 'sqlite:////var/lib/barbican/barbican.sqlite',
|
||||
|
@ -42,7 +39,6 @@ describe 'barbican::db' do
|
|||
it { is_expected.to contain_barbican_config('DEFAULT/sql_idle_timeout').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_size').with_value('<SERVICE DEFAULT>') }
|
||||
it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||
|
||||
end
|
||||
|
||||
context 'with specific parameters' do
|
||||
|
@ -114,48 +110,6 @@ describe 'barbican::db' do
|
|||
end
|
||||
end
|
||||
|
||||
context 'on Debian platforms' do
|
||||
let :facts do
|
||||
@default_facts.merge({
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => 'jessie',
|
||||
})
|
||||
end
|
||||
|
||||
it_configures 'barbican::db'
|
||||
|
||||
context 'with sqlite backend' do
|
||||
let :params do
|
||||
{ :database_connection => 'sqlite:///var/lib/barbican/barbican.sqlite', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
is_expected.to contain_package('python-pysqlite2').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-pysqlite2',
|
||||
:tag => 'openstack'
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
{ :database_connection => 'mysql+pymysql://barbican:barbican@localhost/barbican', }
|
||||
end
|
||||
|
||||
it 'install the proper backend package' do
|
||||
is_expected.to contain_package('python-pymysql').with(
|
||||
:ensure => 'present',
|
||||
:name => 'python-pymysql',
|
||||
:tag => 'openstack'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
shared_examples_for 'barbican db on redhat' do
|
||||
context 'using pymysql driver' do
|
||||
let :params do
|
||||
|
@ -184,6 +138,4 @@ describe 'barbican::db' do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue