Debian is using python3-magnumclient

Change-Id: I2467cb502ca3f1776ab10beeb9547fa7d27fcea7
This commit is contained in:
zhubingbing 2018-04-12 11:17:14 +08:00
parent d9bad8a8e1
commit 4c18149d86
2 changed files with 15 additions and 4 deletions

View File

@ -4,6 +4,13 @@
#
class magnum::params {
include ::openstacklib::defaults
if ($::os_package_type == 'debian') {
$pyvers = '3'
} else {
$pyvers = ''
}
$group = 'magnum'
case $::osfamily {
'RedHat': {
@ -24,7 +31,7 @@ class magnum::params {
# service names
$api_service = 'magnum-api'
$conductor_service = 'magnum-conductor'
$client_package = 'python-magnumclient'
$client_package = "python${pyvers}-magnumclient"
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem")

View File

@ -10,7 +10,7 @@ describe 'magnum::client' do
it 'installs magnum client package' do
is_expected.to contain_package('python-magnumclient').with(
:ensure => 'present',
:name => platform_params[:client_package],
:name => platform_params[:client_package_name],
:tag => 'openstack',
)
end
@ -27,9 +27,13 @@ describe 'magnum::client' do
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :client_package => 'python-magnumclient' }
if facts[:os_package_type] == 'debian'
{ :client_package_name => 'python3-magnumclient' }
else
{ :client_package_name => 'python-magnumclient' }
end
when 'RedHat'
{ :client_package => 'python2-magnumclient' }
{ :client_package_name => 'python2-magnumclient' }
end
end
it_configures 'magnum client'