diff --git a/manifests/params.pp b/manifests/params.pp index 6105f50a..bbc2d6e6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -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' diff --git a/spec/classes/barbican_client_spec.rb b/spec/classes/barbican_client_spec.rb index e717a712..0d2c128e 100644 --- a/spec/classes/barbican_client_spec.rb +++ b/spec/classes/barbican_client_spec.rb @@ -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 diff --git a/spec/classes/barbican_db_spec.rb b/spec/classes/barbican_db_spec.rb index 5d21406e..50980377 100644 --- a/spec/classes/barbican_db_spec.rb +++ b/spec/classes/barbican_db_spec.rb @@ -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 => '', :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('') } it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_size').with_value('') } it { is_expected.to contain_barbican_config('DEFAULT/sql_pool_max_overflow').with_value('') } - 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 -