vpp: Accept array for physnets parameter

The ml2_vpp/physnets parameter is ListOpt which takes comma separated
list, so accepting an array value allows users to set the parameter
using the same type.

Change-Id: I8ef9bd75cd5afbdb784d584a2d9f282532370585
This commit is contained in:
Takashi Kajinami
2021-05-13 21:22:27 +09:00
parent e8c9ec9015
commit 3d85a90209
2 changed files with 12 additions and 3 deletions

View File

@@ -61,7 +61,7 @@ class neutron::agents::ml2::vpp (
}
neutron_agent_vpp {
'ml2_vpp/physnets': value => $physnets;
'ml2_vpp/physnets': value => join(any2array($physnets), ',');
'ml2_vpp/etcd_host': value => $etcd_host;
'ml2_vpp/etcd_port': value => $etcd_port;
'ml2_vpp/etcd_user': value => $etcd_user;

View File

@@ -67,10 +67,19 @@ describe 'neutron::agents::ml2::vpp' do
context 'when supplying a physnet mapping' do
before :each do
params.merge!(:physnets => 'physnet:GigabitEthernet2/2/0')
params.merge!(:physnets => 'physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
end
it 'should configure physnets' do
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('physnet:GigabitEthernet2/2/0')
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
end
end
context 'when supplying a physnet mapping in array' do
before :each do
params.merge!(:physnets => ['physnet0:GigabitEthernet2/2/0', 'physnet1:GigabitEthernet2/2/1'])
end
it 'should configure physnets' do
should contain_neutron_agent_vpp('ml2_vpp/physnets').with_value('physnet0:GigabitEthernet2/2/0,physnet1:GigabitEthernet2/2/1')
end
end