Accept array for standalone_network_plugin_allowed_ip_ranges

... because this parameter is ListOpt which accepts a comma-separated
strings.

Change-Id: I1db1e4f64d97dea29f06745a1afc86eaa18de776
This commit is contained in:
Takashi Kajinami 2022-03-20 23:57:04 +09:00
parent b903e954ed
commit 3c5f29c092
2 changed files with 26 additions and 7 deletions

View File

@ -47,12 +47,19 @@ define manila::network::standalone (
$standalone_plugin_name = 'manila.network.standalone_network_plugin.StandaloneNetworkPlugin'
manila_config {
"${name}/network_api_class": value => $standalone_plugin_name;
"${name}/standalone_network_plugin_gateway": value => $standalone_network_plugin_gateway;
"${name}/standalone_network_plugin_mask": value => $standalone_network_plugin_mask;
"${name}/standalone_network_plugin_segmentation_id": value => $standalone_network_plugin_segmentation_id;
"${name}/standalone_network_plugin_allowed_ip_ranges": value => $standalone_network_plugin_allowed_ip_ranges;
"${name}/network_plugin_ipv4_enabled": value => $network_plugin_ipv4_enabled;
"${name}/network_plugin_ipv6_enabled": value => $network_plugin_ipv6_enabled;
"${name}/network_api_class":
value => $standalone_plugin_name;
"${name}/standalone_network_plugin_gateway":
value => $standalone_network_plugin_gateway;
"${name}/standalone_network_plugin_mask":
value => $standalone_network_plugin_mask;
"${name}/standalone_network_plugin_segmentation_id":
value => $standalone_network_plugin_segmentation_id;
"${name}/standalone_network_plugin_allowed_ip_ranges":
value => join(any2array($standalone_network_plugin_allowed_ip_ranges), ',');
"${name}/network_plugin_ipv4_enabled":
value => $network_plugin_ipv4_enabled;
"${name}/network_plugin_ipv6_enabled":
value => $network_plugin_ipv6_enabled;
}
}

View File

@ -52,6 +52,18 @@ describe 'manila::network::standalone' do
.with_value(false)
end
end
context 'with standalone_network_plugin_allowed_ip_ranges set by array' do
before do
params.merge!({
:standalone_network_plugin_allowed_ip_ranges => ['10.0.0.10-10.0.0.20', '10.0.0.30-10.0.0.40'],
})
end
it 'configures standalone network plugin' do
is_expected.to contain_manila_config('standalone/standalone_network_plugin_allowed_ip_ranges')\
.with_value('10.0.0.10-10.0.0.20,10.0.0.30-10.0.0.40')
end
end
end
on_supported_os({