Fix name of networking-ansible/baremetal package

We should install python3-* instead of python2-* in CentOS8.
This change fixes the remaining usage of python2-* left for
netwokring-ansible and networking-baremetal.

Change-Id: I136a81cc857130b3befa5df204525bfa6c6f0206
This commit is contained in:
Takashi Kajinami 2021-04-30 11:42:54 +09:00
parent 9c3bf1a7d0
commit 34b5036ed8
7 changed files with 47 additions and 20 deletions

View File

@ -173,7 +173,7 @@ Use user_domain_name instead')
} }
} }
package { 'python2-ironic-neutron-agent': package { 'python-ironic-neutron-agent':
ensure => $package_ensure, ensure => $package_ensure,
name => $::neutron::params::networking_baremetal_agent_package, name => $::neutron::params::networking_baremetal_agent_package,
tag => ['openstack', 'neutron-package'], tag => ['openstack', 'neutron-package'],

View File

@ -75,8 +75,8 @@ class neutron::params {
$fwaas_package = 'openstack-neutron-fwaas' $fwaas_package = 'openstack-neutron-fwaas'
$neutron_wsgi_script_path = '/var/www/cgi-bin/neutron' $neutron_wsgi_script_path = '/var/www/cgi-bin/neutron'
$neutron_wsgi_script_source = '/usr/bin/neutron-api' $neutron_wsgi_script_source = '/usr/bin/neutron-api'
$networking_baremetal_package = 'python2-networking-baremetal' $networking_baremetal_package = "python${pyvers}-networking-baremetal"
$networking_baremetal_agent_package = 'python2-ironic-neutron-agent' $networking_baremetal_agent_package = "python${pyvers}-ironic-neutron-agent"
$networking_baremetal_agent_service = 'ironic-neutron-agent' $networking_baremetal_agent_service = 'ironic-neutron-agent'
$networking_ansible_package = "python${pyvers}-networking-ansible" $networking_ansible_package = "python${pyvers}-networking-ansible"
$mlnx_agent_service = 'neutron-mlnx-agent' $mlnx_agent_service = 'neutron-mlnx-agent'

View File

@ -45,9 +45,10 @@ class neutron::plugins::ml2::networking_ansible(
fail("Unsupported osfamily ${::osfamily}") fail("Unsupported osfamily ${::osfamily}")
} }
ensure_resource('package', 'python2-networking-ansible', ensure_resource('package', 'python-networking-ansible',
{ {
ensure => $package_ensure, ensure => $package_ensure,
name => $::neutron::params::networking_ansible_package,
tag => ['openstack', 'neutron-plugin-ml2-package'] tag => ['openstack', 'neutron-plugin-ml2-package']
} }
) )

View File

@ -21,7 +21,7 @@ class neutron::plugins::ml2::networking_baremetal(
# Drivers are only packaged for RedHat at this time # Drivers are only packaged for RedHat at this time
fail("Unsupported osfamily ${::osfamily}") fail("Unsupported osfamily ${::osfamily}")
} else { } else {
package { 'python2-networking-baremetal': package { 'python-networking-baremetal':
ensure => $package_ensure, ensure => $package_ensure,
name => $::neutron::params::networking_baremetal_package, name => $::neutron::params::networking_baremetal_package,
tag => ['openstack', 'neutron-plugin-ml2-package'], tag => ['openstack', 'neutron-plugin-ml2-package'],

View File

@ -54,13 +54,13 @@ describe 'neutron::agents::ml2::networking_baremetal' do
end end
it 'installs ironic-neutron-agent agent package' do it 'installs ironic-neutron-agent agent package' do
should contain_package('python2-ironic-neutron-agent').with( should contain_package('python-ironic-neutron-agent').with(
:name => platform_params[:networking_baremetal_agent_package], :name => platform_params[:networking_baremetal_agent_package],
:ensure => p[:package_ensure], :ensure => p[:package_ensure],
:tag => ['openstack', 'neutron-package'], :tag => ['openstack', 'neutron-package'],
) )
should contain_package('python2-ironic-neutron-agent').that_requires('Anchor[neutron::install::begin]') should contain_package('python-ironic-neutron-agent').that_requires('Anchor[neutron::install::begin]')
should contain_package('python2-ironic-neutron-agent').that_notifies('Anchor[neutron::install::end]') should contain_package('python-ironic-neutron-agent').that_notifies('Anchor[neutron::install::end]')
end end
it 'configures networking-baremetal ironic-neutron-agent service' do it 'configures networking-baremetal ironic-neutron-agent service' do
@ -101,8 +101,18 @@ describe 'neutron::agents::ml2::networking_baremetal' do
let (:platform_params) do let (:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'RedHat' when 'RedHat'
{ :networking_baremetal_agent_package => 'python2-ironic-neutron-agent', if facts[:operatingsystem] == 'Fedora'
:networking_baremetal_agent_service => 'ironic-neutron-agent' } { :networking_baremetal_agent_package => 'python3-ironic-neutron-agent',
:networking_baremetal_agent_service => 'ironic-neutron-agent' }
else
if facts[:operatingsystemmajrelease] > '7'
{ :networking_baremetal_agent_package => 'python3-ironic-neutron-agent',
:networking_baremetal_agent_service => 'ironic-neutron-agent' }
else
{ :networking_baremetal_agent_package => 'python2-ironic-neutron-agent',
:networking_baremetal_agent_service => 'ironic-neutron-agent' }
end
end
end end
end end
case facts[:osfamily] case facts[:osfamily]

View File

@ -30,14 +30,14 @@ describe 'neutron::plugins::ml2::networking_ansible' do
it { should contain_class('neutron::params') } it { should contain_class('neutron::params') }
it 'installs networking-ansible python2-networking-ansible package' do it 'installs networking-ansible python-networking-ansible package' do
should contain_package('python2-networking-ansible').with( should contain_package('python-networking-ansible').with(
:name => platform_params[:networking_ansible_package], :name => platform_params[:networking_ansible_package],
:ensure => p[:package_ensure], :ensure => p[:package_ensure],
:tag => ['openstack', 'neutron-plugin-ml2-package'], :tag => ['openstack', 'neutron-plugin-ml2-package'],
) )
should contain_package('python2-networking-ansible').that_requires('Anchor[neutron::install::begin]') should contain_package('python-networking-ansible').that_requires('Anchor[neutron::install::begin]')
should contain_package('python2-networking-ansible').that_notifies('Anchor[neutron::config::end]') should contain_package('python-networking-ansible').that_notifies('Anchor[neutron::config::end]')
end end
it 'should configure non-host config' do it 'should configure non-host config' do
@ -73,7 +73,15 @@ describe 'neutron::plugins::ml2::networking_ansible' do
let (:platform_params) do let (:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'RedHat' when 'RedHat'
{ :networking_ansible_package => 'python2-networking-ansible'} if facts[:operatingsystem] == 'Fedora'
{ :networking_ansible_package => 'python3-networking-ansible'}
else
if facts[:operatingsystemmajrelease] > '7'
{ :networking_ansible_package => 'python3-networking-ansible'}
else
{ :networking_ansible_package => 'python2-networking-ansible'}
end
end
end end
end end
case facts[:osfamily] case facts[:osfamily]

View File

@ -18,14 +18,14 @@ describe 'neutron::plugins::ml2::networking_baremetal' do
it { should contain_class('neutron::params') } it { should contain_class('neutron::params') }
it 'installs networking-baremetal python2-networking-baremetal package' do it 'installs networking-baremetal python-networking-baremetal package' do
should contain_package('python2-networking-baremetal').with( should contain_package('python-networking-baremetal').with(
:name => platform_params[:networking_baremetal_package], :name => platform_params[:networking_baremetal_package],
:ensure => p[:package_ensure], :ensure => p[:package_ensure],
:tag => ['openstack', 'neutron-plugin-ml2-package'], :tag => ['openstack', 'neutron-plugin-ml2-package'],
) )
should contain_package('python2-networking-baremetal').that_requires('Anchor[neutron::install::begin]') should contain_package('python-networking-baremetal').that_requires('Anchor[neutron::install::begin]')
should contain_package('python2-networking-baremetal').that_notifies('Anchor[neutron::config::end]') should contain_package('python-networking-baremetal').that_notifies('Anchor[neutron::config::end]')
end end
end end
@ -39,7 +39,15 @@ describe 'neutron::plugins::ml2::networking_baremetal' do
let (:platform_params) do let (:platform_params) do
case facts[:osfamily] case facts[:osfamily]
when 'RedHat' when 'RedHat'
{ :networking_baremetal_package => 'python2-networking-baremetal'} if facts[:operatingsystem] == 'Fedora'
{ :networking_baremetal_package => 'python3-networking-baremetal'}
else
if facts[:operatingsystemmajrelease] > '7'
{ :networking_baremetal_package => 'python3-networking-baremetal'}
else
{ :networking_baremetal_package => 'python2-networking-baremetal'}
end
end
end end
end end
case facts[:osfamily] case facts[:osfamily]