From 2c5ed70823415e4cfe35ddf1555ee63df61be9b3 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 2 Jan 2021 11:05:12 +0900 Subject: [PATCH] Replace vnic_type_blacklist by vnic_type_prohibit_list ... to follow renaming in neutron[1]. [1] 055036ba2bc1fd1cfc54ef63dc6cb82037111950 Change-Id: I8891efc94ceafe7ee7c789b68c410629fc240c91 --- manifests/plugins/ml2/ovs_driver.pp | 32 +++++++++++++++---- manifests/plugins/ml2/sriov_driver.pp | 32 +++++++++++++++---- ...c_type_prohibit_list-fc946ec70ce9115d.yaml | 5 +++ .../neutron_plugins_ml2_ovs_driver_spec.rb | 10 +++--- .../neutron_plugins_ml2_sriov_driver_spec.rb | 10 +++--- 5 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 releasenotes/notes/vnic_type_prohibit_list-fc946ec70ce9115d.yaml diff --git a/manifests/plugins/ml2/ovs_driver.pp b/manifests/plugins/ml2/ovs_driver.pp index 774b8c521..7d4542dce 100644 --- a/manifests/plugins/ml2/ovs_driver.pp +++ b/manifests/plugins/ml2/ovs_driver.pp @@ -14,23 +14,43 @@ # # === Parameters: # -# [*vnic_type_blacklist*] +# [*vnic_type_prohibit_list*] # (optional) list of VNIC types for which support in Neutron is # administratively prohibited by the OVS mechanism driver # Defaults to [] # +# DEPRECATED PARAMETERS +# +# [*vnic_type_blacklist*] +# (optional) list of VNIC types for which support in Neutron is +# administratively prohibited by the OVS mechanism driver +# Defaults to undef +# class neutron::plugins::ml2::ovs_driver ( - $vnic_type_blacklist = [], + $vnic_type_prohibit_list = [], + # DEPRECATED PARAMETERS + $vnic_type_blacklist = undef, ){ - validate_legacy(Array, 'validate_array', $vnic_type_blacklist) - if !empty($vnic_type_blacklist) { + if $vnic_type_blacklist != undef { + warning('The vnic_type_blacklist parameter is deprecated. Use vnic_type_prohibit_list instead') + $vnic_type_prohibit_list_real = $vnic_type_blacklist + } else { + $vnic_type_prohibit_list_real = $vnic_type_prohibit_list + } + + validate_legacy(Array, 'validate_array', $vnic_type_prohibit_list_real) + if !empty($vnic_type_prohibit_list_real) { neutron_plugin_ml2 { - 'ovs_driver/vnic_type_blacklist': value => join(any2array($vnic_type_blacklist), ','); + 'ovs_driver/vnic_type_prohibit_list': value => join(any2array($vnic_type_prohibit_list_real), ','); } } else { neutron_plugin_ml2 { - 'ovs_driver/vnic_type_blacklist': value => $::os_service_default; + 'ovs_driver/vnic_type_prohibit_list': value => $::os_service_default; } } + + neutron_plugin_ml2 { + 'ovs_driver/vnic_type_blacklist': ensure => absent; + } } diff --git a/manifests/plugins/ml2/sriov_driver.pp b/manifests/plugins/ml2/sriov_driver.pp index c14df7006..493929501 100644 --- a/manifests/plugins/ml2/sriov_driver.pp +++ b/manifests/plugins/ml2/sriov_driver.pp @@ -14,23 +14,43 @@ # # === Parameters: # -# [*vnic_type_blacklist*] +# [*vnic_type_prohibit_list*] # (optional) list of VNIC types for which support in Neutron is # administratively prohibited by the SRIOV mechanism driver # Defaults to [] # +# DEPRECATED PARAMETERS +# +# [*vnic_type_blacklist*] +# (optional) list of VNIC types for which support in Neutron is +# administratively prohibited by the OVS mechanism driver +# Defaults to undef +# class neutron::plugins::ml2::sriov_driver ( - $vnic_type_blacklist= [], + $vnic_type_prohibit_list = [], + # DEPRECATED PARAMETERS + $vnic_type_blacklist = undef, ){ - validate_legacy(Array, 'validate_array', $vnic_type_blacklist) - if !empty($vnic_type_blacklist) { + if $vnic_type_blacklist != undef { + warning('The vnic_type_blacklist parameter is deprecated. Use vnic_type_prohibit_list instead') + $vnic_type_prohibit_list_real = $vnic_type_blacklist + } else { + $vnic_type_prohibit_list_real = $vnic_type_prohibit_list + } + + validate_legacy(Array, 'validate_array', $vnic_type_prohibit_list_real) + if !empty($vnic_type_prohibit_list_real) { neutron_plugin_ml2 { - 'sriov_driver/vnic_type_blacklist': value => join(any2array($vnic_type_blacklist), ','); + 'sriov_driver/vnic_type_prohibit_list': value => join(any2array($vnic_type_prohibit_list_real), ','); } } else { neutron_plugin_ml2 { - 'sriov_driver/vnic_type_blacklist': value => $::os_service_default; + 'sriov_driver/vnic_type_prohibit_list': value => $::os_service_default; } } + + neutron_plugin_ml2 { + 'sriov_driver/vnic_type_blacklist': ensure => absent; + } } diff --git a/releasenotes/notes/vnic_type_prohibit_list-fc946ec70ce9115d.yaml b/releasenotes/notes/vnic_type_prohibit_list-fc946ec70ce9115d.yaml new file mode 100644 index 000000000..3b2bc0620 --- /dev/null +++ b/releasenotes/notes/vnic_type_prohibit_list-fc946ec70ce9115d.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + The ``vnic_type_blacklist`` parameter has been deprecated. Use the + ``vnic_type_prohibit_list`` parameter instead. diff --git a/spec/classes/neutron_plugins_ml2_ovs_driver_spec.rb b/spec/classes/neutron_plugins_ml2_ovs_driver_spec.rb index 96f429ea6..01078cfba 100644 --- a/spec/classes/neutron_plugins_ml2_ovs_driver_spec.rb +++ b/spec/classes/neutron_plugins_ml2_ovs_driver_spec.rb @@ -23,17 +23,17 @@ describe 'neutron::plugins::ml2::ovs_driver' do end it 'should set the default values' do - should contain_neutron_plugin_ml2('ovs_driver/vnic_type_blacklist').with_value("") + should contain_neutron_plugin_ml2('ovs_driver/vnic_type_prohibit_list').with_value("") end end - context 'when vnic_type_blacklist is not empty list' do + context 'when vnic_type_prohibit_list is not empty list' do let :params do - { :vnic_type_blacklist => ['direct'] } + { :vnic_type_prohibit_list => ['direct'] } end - it 'should configure direct in vnic_type_blacklist' do - should contain_neutron_plugin_ml2('ovs_driver/vnic_type_blacklist').with_value("direct") + it 'should configure direct in vnic_type_prohibit_list' do + should contain_neutron_plugin_ml2('ovs_driver/vnic_type_prohibit_list').with_value("direct") end end end diff --git a/spec/classes/neutron_plugins_ml2_sriov_driver_spec.rb b/spec/classes/neutron_plugins_ml2_sriov_driver_spec.rb index fd83f6e84..ca069a38a 100644 --- a/spec/classes/neutron_plugins_ml2_sriov_driver_spec.rb +++ b/spec/classes/neutron_plugins_ml2_sriov_driver_spec.rb @@ -23,17 +23,17 @@ describe 'neutron::plugins::ml2::sriov_driver' do end it 'should set the default values' do - should contain_neutron_plugin_ml2('sriov_driver/vnic_type_blacklist').with_value("") + should contain_neutron_plugin_ml2('sriov_driver/vnic_type_prohibit_list').with_value("") end end - context 'when vnic_type_blacklist is not empty list' do + context 'when vnic_type_prohibit_list is not empty list' do let :params do - { :vnic_type_blacklist => ['direct'] } + { :vnic_type_prohibit_list => ['direct'] } end - it 'should configure direct in vnic_type_blacklist' do - should contain_neutron_plugin_ml2('sriov_driver/vnic_type_blacklist').with_value("direct") + it 'should configure direct in vnic_type_prohibit_list' do + should contain_neutron_plugin_ml2('sriov_driver/vnic_type_prohibit_list').with_value("direct") end end end