sfc: Accept array for drivers
The drivers option in networking-sfc both accept list values, which defines ordered lists of drivers. Change-Id: Iecc9cfda8bd74c758b4dbf433fed2ea293725afd Signed-off-by: Takashi Kajinami <kajinamit@oss.nttdata.com>
This commit is contained in:
@@ -25,12 +25,12 @@
|
|||||||
# Whether to install the sfc extension package
|
# Whether to install the sfc extension package
|
||||||
# Default to 'present'
|
# Default to 'present'
|
||||||
#
|
#
|
||||||
# [*sfc_driver*]
|
# [*sfc_drivers*]
|
||||||
# (optional) SFC driver to use
|
# (optional) An ordered list of service chain drivers
|
||||||
# Defaults to $facts['os_service_default']
|
# Defaults to $facts['os_service_default']
|
||||||
#
|
#
|
||||||
# [*fc_driver*]
|
# [*fc_drivers*]
|
||||||
# (optional) Flow classifier driver to use
|
# (optional) An ordered list of flow classifier drivers
|
||||||
# Defaults to $facts['os_service_default']
|
# Defaults to $facts['os_service_default']
|
||||||
#
|
#
|
||||||
# [*sync_db*]
|
# [*sync_db*]
|
||||||
@@ -42,17 +42,44 @@
|
|||||||
# in the sfc config.
|
# in the sfc config.
|
||||||
# Default to false.
|
# Default to false.
|
||||||
#
|
#
|
||||||
|
# DEPRECATED PARAMETERS
|
||||||
|
#
|
||||||
|
# [*sfc_driver*]
|
||||||
|
# (optional) SFC driver to use
|
||||||
|
# Defaults to $facts['os_service_default']
|
||||||
|
#
|
||||||
|
# [*fc_driver*]
|
||||||
|
# (optional) Flow classifier driver to use
|
||||||
|
# Defaults to $facts['os_service_default']
|
||||||
|
#
|
||||||
class neutron::services::sfc (
|
class neutron::services::sfc (
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
$sfc_driver = $facts['os_service_default'],
|
$sfc_drivers = $facts['os_service_default'],
|
||||||
$fc_driver = $facts['os_service_default'],
|
$fc_drivers = $facts['os_service_default'],
|
||||||
Boolean $sync_db = false,
|
Boolean $sync_db = false,
|
||||||
$purge_config = false,
|
$purge_config = false,
|
||||||
|
# DEPRECATED PARAMETERS
|
||||||
|
$sfc_driver = undef,
|
||||||
|
$fc_driver = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include neutron::deps
|
include neutron::deps
|
||||||
include neutron::params
|
include neutron::params
|
||||||
|
|
||||||
|
if $sfc_driver != undef {
|
||||||
|
warning('The sfc_driver parameter is deprecated. Use the sfc_drivers parameter instead.')
|
||||||
|
$sfc_drivers_real = $sfc_driver
|
||||||
|
} else {
|
||||||
|
$sfc_drivers_real = $sfc_drivers
|
||||||
|
}
|
||||||
|
|
||||||
|
if $fc_driver != undef {
|
||||||
|
warning('The fc_driver parameter is deprecated. Use the fc_drivers parameter instead.')
|
||||||
|
$fc_drivers_real = $fc_driver
|
||||||
|
} else {
|
||||||
|
$fc_drivers_real = $fc_drivers
|
||||||
|
}
|
||||||
|
|
||||||
package { 'python-networking-sfc':
|
package { 'python-networking-sfc':
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
name => $::neutron::params::sfc_package,
|
name => $::neutron::params::sfc_package,
|
||||||
@@ -60,8 +87,8 @@ class neutron::services::sfc (
|
|||||||
}
|
}
|
||||||
|
|
||||||
neutron_sfc_service_config {
|
neutron_sfc_service_config {
|
||||||
'sfc/drivers': value => $sfc_driver;
|
'sfc/drivers': value => join(any2array($sfc_drivers_real), ',');
|
||||||
'flowclassifier/drivers': value => $fc_driver;
|
'flowclassifier/drivers': value => join(any2array($fc_drivers_real), ',');
|
||||||
}
|
}
|
||||||
|
|
||||||
resources { 'neutron_sfc_service_config':
|
resources { 'neutron_sfc_service_config':
|
||||||
|
9
releasenotes/notes/sfc-drivers-0efd36ce488c3026.yaml
Normal file
9
releasenotes/notes/sfc-drivers-0efd36ce488c3026.yaml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``neutron::servics::sfc::sfc_driver`` parameter has been deprecated,
|
||||||
|
in favor of the new ``sfc_drivers`` parameter.
|
||||||
|
|
||||||
|
- |
|
||||||
|
The ``neutron::servics::sfc::fc_driver`` parameter has been deprecated,
|
||||||
|
in favor of the new ``fc_drivers`` parameter.
|
@@ -59,6 +59,20 @@ describe 'neutron::services::sfc' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'with sfc and classifier drivers' do
|
context 'with sfc and classifier drivers' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:sfc_drivers => 'odl_v2',
|
||||||
|
:fc_drivers => 'odl_v2'
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures networking-sfc.conf' do
|
||||||
|
should contain_neutron_sfc_service_config('sfc/drivers').with_value('odl_v2')
|
||||||
|
should contain_neutron_sfc_service_config('flowclassifier/drivers').with_value('odl_v2')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with sfc and classifier drivers (deprecated parameters)' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:sfc_driver => 'odl_v2',
|
:sfc_driver => 'odl_v2',
|
||||||
|
Reference in New Issue
Block a user