Merge "Replace remaining validate_legacy"

This commit is contained in:
Zuul 2023-09-15 16:07:23 +00:00 committed by Gerrit Code Review
commit eca9264c0d
4 changed files with 11 additions and 28 deletions

View File

@ -64,12 +64,14 @@ class neutron::plugins::ml2::arista::l3(
include neutron::deps include neutron::deps
require neutron::plugins::ml2 require neutron::plugins::ml2
if !is_service_default($mlag_config) { # TODO(tkajinam): Reconsider how we implement this. We probably should allow
validate_legacy(Boolean, 'validate_bool', $mlag_config) # more flexible values like 'on' supported by oslo.config.
if $mlag_config and is_service_default($secondary_l3_host) { # if !is_service_default($mlag_config) {
fail('Must set secondary_l3_host when mlag_config is true.') # validate_legacy(Boolean, 'validate_bool', $mlag_config)
} # if $mlag_config and is_service_default($secondary_l3_host) {
} # fail('Must set secondary_l3_host when mlag_config is true.')
# }
# }
neutron_plugin_ml2 { neutron_plugin_ml2 {
'l3_arista/primary_l3_host' : value => $primary_l3_host; 'l3_arista/primary_l3_host' : value => $primary_l3_host;

View File

@ -282,12 +282,9 @@ class neutron::server (
include neutron::policy include neutron::policy
if !is_service_default($dhcp_load_type) { if !is_service_default($dhcp_load_type) {
validate_legacy(Enum['networks', 'subnets', 'ports'], 'validate_re', $dhcp_load_type, if ! ($dhcp_load_type in ['networks', 'subnets', 'ports'] ) {
[['^networks$', '^subnets$', '^ports$']]) fail('Unsupported dhcp_load_type. It should be one of networks, subnets and ports.')
} }
if !is_service_default($service_providers) {
validate_legacy(Array, 'validate_array', $service_providers)
} }
if $ensure_vpnaas_package { if $ensure_vpnaas_package {

View File

@ -56,10 +56,6 @@ class neutron::services::l2gw (
include neutron::deps include neutron::deps
include neutron::params include neutron::params
if !is_service_default($service_providers) {
validate_legacy(Array, 'validate_array', $service_providers)
}
ensure_resource( 'package', 'python-networking-l2gw', { ensure_resource( 'package', 'python-networking-l2gw', {
'ensure' => $package_ensure, 'ensure' => $package_ensure,
'name' => $::neutron::params::l2gw_package, 'name' => $::neutron::params::l2gw_package,

View File

@ -61,18 +61,6 @@ describe 'neutron::plugins::ml2::arista::l3' do
should contain_neutron_plugin_ml2('l3_arista/conn_timeout').with_value(p[:conn_timeout]) should contain_neutron_plugin_ml2('l3_arista/conn_timeout').with_value(p[:conn_timeout])
should contain_neutron_plugin_ml2('l3_arista/use_vrf').with_value(p[:use_vrf]) should contain_neutron_plugin_ml2('l3_arista/use_vrf').with_value(p[:use_vrf])
end end
context 'with mlag enabled but secondary l3 host missing' do
before :each do
params.merge!({
:mlag_config => true
})
end
it 'should fail' do
should raise_error(Puppet::Error, /Must set secondary_l3_host when mlag_config is true./)
end
end
end end
on_supported_os({ on_supported_os({