diff --git a/manifests/params.pp b/manifests/params.pp index 4b04271..7f39fbf 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,12 @@ class cloudkitty::params { include ::openstacklib::defaults - $client_package_name = 'python-cloudkittyclient' + if ($::os_package_type == 'debian') { + $pyvers = '3' + } else { + $pyvers = '' + } + $client_package_name = "python${pyvers}-cloudkittyclient" $api_service_name = 'cloudkitty-api' $processor_service_name = 'cloudkitty-processor' $group = 'cloudkitty' diff --git a/spec/classes/cloudkitty_client_spec.rb b/spec/classes/cloudkitty_client_spec.rb index da4d362..bc5fee3 100644 --- a/spec/classes/cloudkitty_client_spec.rb +++ b/spec/classes/cloudkitty_client_spec.rb @@ -10,7 +10,7 @@ describe 'cloudkitty::client' do it 'installs cloudkitty client package' do is_expected.to contain_package('python-cloudkittyclient').with( :ensure => 'present', - :name => 'python-cloudkittyclient', + :name => platform_params[:client_package_name], :tag => 'openstack', ) end @@ -24,6 +24,19 @@ describe 'cloudkitty::client' do facts.merge!(OSDefaults.get_facts()) end + let(:platform_params) do + case facts[:osfamily] + when 'Debian' + if facts[:os_package_type] == 'debian' + { :client_package_name => 'python3-cloudkittyclient' } + else + { :client_package_name => 'python-cloudkittyclient' } + end + when 'RedHat' + { :client_package_name => 'python-cloudkittyclient' } + end + end + it_configures 'cloudkitty client' end end