Inherit pyvers from openstacklib::defaults

Change-Id: Ie4fcf57505945043f2fda2e9d4aeeaff4f377dfa
This commit is contained in:
Tobias Urdin 2019-01-17 21:38:20 +01:00
parent 9667e22cd9
commit 586a61df0b
8 changed files with 49 additions and 22 deletions

View File

@ -22,18 +22,15 @@
class ironic::params {
include ::openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
$pyver3 = $::openstacklib::defaults::pyver3
if ($::os_package_type == 'debian') {
$pyvers = '3'
$pyver3 = '3'
$syslinux_path_custom = '/usr/lib/syslinux'
} elsif ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$pyvers = '3'
$pyver3 = '3.6'
$syslinux_path_custom = '/tftpboot'
} else {
$pyvers = ''
$pyver3 = '2.7'
$syslinux_path_custom = '/var/lib/tftpboot'
}

View File

@ -47,11 +47,7 @@ describe 'ironic::client' do
let(:platform_params) do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian'
{ :client_package_name => 'python3-ironicclient' }
else
{ :client_package_name => 'python-ironicclient' }
end
{ :client_package_name => 'python3-ironicclient' }
when 'RedHat'
{ :client_package_name => 'python-ironicclient' }
end

View File

@ -26,7 +26,7 @@ describe 'ironic::drivers::drac' do
it 'installs dracclient package' do
is_expected.to contain_package('python-dracclient').with(
:ensure => 'present',
:name => 'python-dracclient',
:name => platform_params[:dracclient_package_name],
:tag => ['openstack', 'ironic-package'],
)
end
@ -40,6 +40,16 @@ describe 'ironic::drivers::drac' do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :dracclient_package_name => 'python3-dracclient' }
when 'RedHat'
{ :dracclient_package_name => 'python-dracclient' }
end
end
it_behaves_like 'ironic drac driver'
end
end

View File

@ -36,7 +36,7 @@ describe 'ironic::drivers::ilo' do
it 'installs proliantutils package' do
is_expected.to contain_package('python-proliantutils').with(
:ensure => 'present',
:name => 'python-proliantutils',
:name => platform_params[:proliantutils_package_name],
:tag => ['openstack', 'ironic-package'],
)
end
@ -65,6 +65,16 @@ describe 'ironic::drivers::ilo' do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :proliantutils_package_name => 'python3-proliantutils' }
when 'RedHat'
{ :proliantutils_package_name => 'python-proliantutils' }
end
end
it_behaves_like 'ironic ilo driver'
end
end

View File

@ -34,7 +34,7 @@ describe 'ironic::drivers::redfish' do
it 'installs sushy package' do
is_expected.to contain_package('python-sushy').with(
:ensure => 'present',
:name => 'python-sushy',
:name => platform_params[:sushy_package_name],
:tag => ['openstack', 'ironic-package'],
)
end
@ -59,6 +59,16 @@ describe 'ironic::drivers::redfish' do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :sushy_package_name => 'python3-sushy' }
when 'RedHat'
{ :sushy_package_name => 'python-sushy' }
end
end
it_behaves_like 'ironic redfish driver'
end
end

View File

@ -262,13 +262,8 @@ describe 'ironic' do
let :platform_params do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian' then
ironic_lib_pkgname = 'python3-ironic-lib'
else
ironic_lib_pkgname = 'python-ironic-lib'
end
{ :common_package_name => 'ironic-common',
:lib_package_name => ironic_lib_pkgname }
:lib_package_name => 'python3-ironic-lib' }
when 'RedHat'
{ :common_package_name => 'openstack-ironic-common',
:lib_package_name => 'python-ironic-lib' }

View File

@ -35,7 +35,7 @@ describe 'ironic::inspector::client' do
it 'installs ironic inspector client package' do
is_expected.to contain_package('python-ironic-inspector-client').with(
:ensure => 'present',
:name => 'python-ironic-inspector-client',
:name => platform_params[:ironic_inspector_client_package_name],
:tag => ['openstack', 'ironic-support-package'],
)
end
@ -49,6 +49,15 @@ describe 'ironic::inspector::client' do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{ :ironic_inspector_client_package_name => 'python3-ironic-inspector-client' }
when 'RedHat'
{ :ironic_inspector_client_package_name => 'python-ironic-inspector-client' }
end
end
it_configures 'inspector client'
end
end

View File

@ -94,7 +94,7 @@ describe 'ironic::wsgi::apache' do
:httpd_service_name => 'apache2',
:httpd_ports_file => '/etc/apache2/ports.conf',
:wsgi_script_path => '/usr/lib/cgi-bin/ironic',
:wsgi_script_source => '/usr/lib/python2.7/dist-packages/ironic/api/app.wsgi',
:wsgi_script_source => '/usr/lib/python3/dist-packages/ironic/api/app.wsgi',
}
when 'RedHat'
{