Debian is using Python 3

Change-Id: I45f20d063d0626b2f744a5e63e8e999a6a356c03
This commit is contained in:
Thomas Goirand 2018-04-06 23:14:51 +02:00
parent 80c58df276
commit e47ddb327b
2 changed files with 21 additions and 3 deletions

View File

@ -3,7 +3,12 @@
class glance::params {
include ::openstacklib::defaults
$client_package_name = 'python-glanceclient'
if ($::os_package_type == 'debian') {
$pyvers = '3'
} else {
$pyvers = ''
}
$client_package_name = "python${pyvers}-glanceclient"
$cache_cleaner_command = 'glance-cache-cleaner'
$cache_pruner_command = 'glance-cache-pruner'
@ -26,7 +31,7 @@ class glance::params {
$registry_package_name = 'glance-registry'
$api_service_name = 'glance-api'
$registry_service_name = 'glance-registry'
$pyceph_package_name = 'python-ceph'
$pyceph_package_name = "python${pyvers}-ceph"
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, \

View File

@ -5,7 +5,7 @@ describe 'glance::client' do
shared_examples 'glance client' do
it { is_expected.to contain_class('glance::params') }
it { is_expected.to contain_package('python-glanceclient').with(
:name => 'python-glanceclient',
:name => platform_params[:client_package_name],
:ensure => 'present',
:tag => ['openstack', 'glance-support-package'],
)
@ -20,6 +20,19 @@ describe 'glance::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-glanceclient' }
else
{ :client_package_name => 'python-glanceclient' }
end
when 'RedHat'
{ :client_package_name => 'python-glanceclient' }
end
end
it_configures 'glance client'
end
end