Fix L3 agent's extensions list

L3 agent's extensions list should be passed as an array
to the neutron::agents::l3 class and then it should be converted
to the comma separated string in the L3 agent's config.
This patch changes expected type of the variable and
adds that such conversion from an array to string.

Change-Id: I0650085d2aa2c3492b175c565976705c977fd806
This commit is contained in:
Slawek Kaplonski 2021-04-13 15:48:48 +02:00 committed by Takashi Kajinami
parent bf726e31cf
commit d29611f08a
2 changed files with 22 additions and 2 deletions

View File

@ -80,7 +80,7 @@
# Defaults to $::os_service_default
#
# [*extensions*]
# (optional) L3 agent extensions to enable.
# (optional) List of the L3 agent extensions to enable.
# Defaults to $::os_service_default
#
# [*radvd_user*]
@ -161,7 +161,7 @@ class neutron::agents::l3 (
'DEFAULT/radvd_user': value => $radvd_user;
'ovs/integration_bridge': value => $ovs_integration_bridge;
'agent/availability_zone': value => $availability_zone;
'agent/extensions': value => $extensions;
'agent/extensions': value => join(any2array($extensions), ',');
}
if $::neutron::params::l3_agent_package {

View File

@ -129,6 +129,26 @@ describe 'neutron::agents::l3' do
should contain_neutron_l3_agent_config('agent/availability_zone').with_value(p[:availability_zone])
end
end
context 'with extensions in string' do
before :each do
params.merge!(:extensions => 'fip_qos,gateway_ip_qos,port_forwarding')
end
it 'configures extentions' do
should contain_neutron_l3_agent_config('agent/extensions').with_value('fip_qos,gateway_ip_qos,port_forwarding')
end
end
context 'with extensions in array' do
before :each do
params.merge!(:extensions => ['fip_qos', 'gateway_ip_qos', 'port_forwarding'])
end
it 'configures extentions' do
should contain_neutron_l3_agent_config('agent/extensions').with_value('fip_qos,gateway_ip_qos,port_forwarding')
end
end
end
shared_examples 'neutron::agents::l3 on Debian' do