Merge "Inherit pyvers from openstacklib::defaults"
This commit is contained in:
@@ -4,13 +4,7 @@
|
|||||||
#
|
#
|
||||||
class barbican::params {
|
class barbican::params {
|
||||||
include ::openstacklib::defaults
|
include ::openstacklib::defaults
|
||||||
|
$pyvers = $::openstacklib::defaults::pyvers
|
||||||
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
|
|
||||||
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
|
|
||||||
$pyvers = '3'
|
|
||||||
} else {
|
|
||||||
$pyvers = ''
|
|
||||||
}
|
|
||||||
|
|
||||||
$client_package_name = "python${pyvers}-barbicanclient"
|
$client_package_name = "python${pyvers}-barbicanclient"
|
||||||
$group = 'barbican'
|
$group = 'barbican'
|
||||||
|
|||||||
@@ -59,11 +59,7 @@ describe 'barbican::client' do
|
|||||||
let(:platform_params) do
|
let(:platform_params) do
|
||||||
case facts[:osfamily]
|
case facts[:osfamily]
|
||||||
when 'Debian'
|
when 'Debian'
|
||||||
if facts[:os_package_type] == 'debian'
|
{ :client_package_name => 'python3-barbicanclient' }
|
||||||
{ :client_package_name => 'python3-barbicanclient' }
|
|
||||||
else
|
|
||||||
{ :client_package_name => 'python-barbicanclient' }
|
|
||||||
end
|
|
||||||
when 'RedHat'
|
when 'RedHat'
|
||||||
{ :client_package_name => 'python-barbicanclient' }
|
{ :client_package_name => 'python-barbicanclient' }
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -20,11 +20,8 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
|
|
||||||
describe 'barbican::db' do
|
describe 'barbican::db' do
|
||||||
|
|
||||||
shared_examples 'barbican::db' do
|
shared_examples 'barbican::db' do
|
||||||
|
|
||||||
context 'with default parameters' do
|
context 'with default parameters' do
|
||||||
|
|
||||||
it { is_expected.to contain_oslo__db('barbican_config').with(
|
it { is_expected.to contain_oslo__db('barbican_config').with(
|
||||||
:db_max_retries => '<SERVICE DEFAULT>',
|
:db_max_retries => '<SERVICE DEFAULT>',
|
||||||
:connection => 'sqlite:////var/lib/barbican/barbican.sqlite',
|
: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_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_size').with_value('<SERVICE DEFAULT>') }
|
||||||
it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_max_overflow').with_value('<SERVICE DEFAULT>') }
|
it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_max_overflow').with_value('<SERVICE DEFAULT>') }
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'with specific parameters' do
|
context 'with specific parameters' do
|
||||||
@@ -114,48 +110,6 @@ describe 'barbican::db' do
|
|||||||
end
|
end
|
||||||
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
|
shared_examples_for 'barbican db on redhat' do
|
||||||
context 'using pymysql driver' do
|
context 'using pymysql driver' do
|
||||||
let :params do
|
let :params do
|
||||||
@@ -184,6 +138,4 @@ describe 'barbican::db' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user