Debian is using Python 3

Change-Id: I98d1a456cad73c83f13a08b42fcf363fea87c66d
This commit is contained in:
Thomas Goirand 2018-04-06 23:12:05 +02:00
parent 8871a9e82f
commit e7e366c118
2 changed files with 20 additions and 2 deletions

View File

@ -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'

View File

@ -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