Inherit pyvers from openstacklib::defaults

Depends-On: I84b767921d151a61429b2c89e6372c4b447f0d7d
Depends-On: I6769ae262cbe112c63c14b43acbbcdff13ea5e16
Depends-On: https://review.openstack.org/#/c/633162/
Change-Id: I77bd1d20b0e4d28b9839531b8c88f345a4bbcd1e
This commit is contained in:
Lee Yarwood 2019-01-11 13:00:51 +00:00 committed by Tobias Urdin
parent 6c4fa4facf
commit fc35904bc4
8 changed files with 46 additions and 28 deletions

View File

@ -4,13 +4,8 @@
#
class neutron::params {
include ::openstacklib::defaults
$pyvers = $::openstacklib::defaults::pyvers
if ($::os_package_type == 'debian') or ($::os['name'] == 'Fedora') or
($::os['family'] == 'RedHat' and Integer.new($::os['release']['major']) > 7) {
$pyvers = '3'
} else {
$pyvers = ''
}
$client_package = "python${pyvers}-neutronclient"
$ovs_agent_service = 'neutron-openvswitch-agent'
$destroy_patch_ports_service = 'neutron-destroy-patch-ports'

View File

@ -215,13 +215,8 @@ describe 'neutron::agents::bgp_dragent' do
:bgp_dragent_service => 'neutron-bgp-dragent',
}
when 'Debian'
if facts[:operatingsystem] == 'Debian'
pkg = 'python3-neutron-dynamic-routing'
else
pkg = 'python-neutron-dynamic-routing'
end
{
:dynamic_routing_package => pkg,
:dynamic_routing_package => 'python3-neutron-dynamic-routing',
:bgp_dragent_package => 'neutron-bgp-dragent',
:bgp_dragent_service => 'neutron-bgp-dragent',
}

View File

@ -95,8 +95,18 @@ describe 'neutron::agents::ml2::vpp' do
end
let :platform_params do
{ :vpp_plugin_package => 'python-networking-vpp',
:vpp_agent_service => 'neutron-vpp-agent' }
case facts[:osfamily]
when 'Debian'
{
:vpp_plugin_package => 'python3-networking-vpp',
:vpp_agent_service => 'neutron-vpp-agent'
}
when 'RedHat'
{
:vpp_plugin_package => 'python-networking-vpp',
:vpp_agent_service => 'neutron-vpp-agent'
}
end
end
it_behaves_like 'neutron plugin vpp agent with ml2 plugin'

View File

@ -25,11 +25,7 @@ describe 'neutron::client' do
let :platform_params do
case facts[:osfamily]
when 'Debian'
if facts[:os_package_type] == 'debian'
{ :client_package => 'python3-neutronclient' }
else
{ :client_package => 'python-neutronclient' }
end
when 'RedHat'
{ :client_package => 'python-neutronclient' }
end

View File

@ -32,7 +32,7 @@ describe 'neutron::services::bgpvpn' do
end
it 'installs bgpvpn package' do
should contain_package('python-networking-bgpvpn').with(
should contain_package(platform_params[:bgpvpn_package_name]).with(
:ensure => params[:package_ensure],
:name => platform_params[:bgpvpn_package_name],
)
@ -80,7 +80,7 @@ describe 'neutron::services::bgpvpn' do
when 'RedHat'
{ :bgpvpn_package_name => 'python-networking-bgpvpn' }
when 'Debian'
{ :bgpvpn_package_name => 'python-networking-bgpvpn' }
{ :bgpvpn_package_name => 'python3-networking-bgpvpn' }
end
end
it_behaves_like 'neutron bgpvpn service plugin'

View File

@ -66,7 +66,7 @@ describe 'neutron::services::fwaas' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:tag => ['neutron-package', 'openstack'],
:name => 'python-neutron-fwaas',
:name => platform_params[:fwaas_package_name],
)
end
end
@ -77,7 +77,7 @@ describe 'neutron::services::fwaas' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:tag => ['neutron-package', 'openstack'],
:name => 'python-neutron-fwaas',
:name => platform_params[:fwaas_package_name],
)
end
end
@ -100,7 +100,7 @@ describe 'neutron::services::fwaas' do
it 'installs neutron fwaas service package' do
should contain_package('neutron-fwaas').with(
:ensure => 'present',
:name => 'openstack-neutron-fwaas',
:name => platform_params[:fwaas_package_name],
)
end
end
@ -114,7 +114,16 @@ describe 'neutron::services::fwaas' do
end
let (:platform_params) do
{}
case facts[:osfamily]
when 'Debian'
{
:fwaas_package_name => 'python3-neutron-fwaas'
}
when 'RedHat'
{
:fwaas_package_name => 'openstack-neutron-fwaas'
}
end
end
it_behaves_like 'neutron fwaas service plugin'

View File

@ -33,7 +33,7 @@ describe 'neutron::services::lbaas' do
end
it 'should contain python-neutron-lbaas package' do
should contain_package('python-neutron-lbaas').with({ :ensure => 'present' })
should contain_package(platform_params[:lbaas_package_name]).with({ :ensure => 'present' })
end
it 'should set certificates options with service defaults' do
@ -69,6 +69,19 @@ describe 'neutron::services::lbaas' do
facts.merge!(OSDefaults.get_facts())
end
let (:platform_params) do
case facts[:osfamily]
when 'Debian'
{
:lbaas_package_name => 'python3-neutron-lbaas'
}
when 'RedHat'
{
:lbaas_package_name => 'python-neutron-lbaas'
}
end
end
it_behaves_like 'neutron lbaas service plugin'
end
end

View File

@ -33,7 +33,7 @@ describe 'neutron::services::sfc' do
end
it 'installs sfc package' do
should contain_package('python-networking-sfc').with(
should contain_package(platform_params[:sfc_package_name]).with(
:ensure => params[:package_ensure],
:name => platform_params[:sfc_package_name],
)
@ -86,7 +86,7 @@ describe 'neutron::services::sfc' do
when 'RedHat'
{ :sfc_package_name => 'python-networking-sfc' }
when 'Debian'
{ :sfc_package_name => 'python-networking-sfc' }
{ :sfc_package_name => 'python3-networking-sfc' }
end
end
it_behaves_like 'neutron sfc service plugin'