Change authentication method for Mellanox sdn controller

Change sdn authentication from basic(username, password) to token
authentication, and as we are in stable branch, we are going to
backport only the new parameter 'token'
and avoid backporting deprecation part.

Depends-on: https://review.opendev.org/817257
Change-Id: Ie8b347a4705045dfa0363284ec41e9e519ec19f9
(cherry picked from commit 8ce1ea3d93)
This commit is contained in:
waleedm 2021-10-19 11:02:14 +00:00
parent 2c16d3b43e
commit 4f2eda540e
3 changed files with 15 additions and 1 deletions

View File

@ -4,6 +4,11 @@
#
# === Parameters
#
# [*sdn_token*]
# (optional) The Mellanox controller token
# Defaults to $::os_service_default
# Example: 'abcdef'
#
# [*sdn_username*]
# (optional) The Mellanox controller username
# Defaults to $::os_service_default
@ -17,7 +22,7 @@
# [*sdn_url*]
# (optional) The Mellanox controller neutron URL
# Defaults to $::os_service_default
# Example: 'http://127.0.0.1/neo'
# Example: 'http://127.0.0.1/ufmRestV3/'
#
# [*sdn_domain*]
# (optional) The Mellanox controller domain
@ -42,6 +47,7 @@
# Defaults to []
#
class neutron::plugins::ml2::mellanox::mlnx_sdn_assist (
$sdn_token = $::os_service_default,
$sdn_username = $::os_service_default,
$sdn_password = $::os_service_default,
$sdn_url = $::os_service_default,
@ -54,7 +60,9 @@ class neutron::plugins::ml2::mellanox::mlnx_sdn_assist (
include neutron::deps
require neutron::plugins::ml2
neutron_plugin_ml2 {
'sdn/token': value => $sdn_token, secret => true;
'sdn/username': value => $sdn_username;
'sdn/password': value => $sdn_password, secret => true;
'sdn/url': value => $sdn_url;

View File

@ -0,0 +1,4 @@
---
features:
- The new ``sdn_token`` parameter to authenticate sdn has been added to
the ``neutron::plugins::ml2::mellanox::mlnx_sdn_assist`` class.

View File

@ -19,6 +19,7 @@ describe 'neutron::plugins::ml2::mellanox::mlnx_sdn_assist' do
let :params do
{
:sdn_token => 'token',
:sdn_username => 'user',
:sdn_password => 'password',
}
@ -30,6 +31,7 @@ describe 'neutron::plugins::ml2::mellanox::mlnx_sdn_assist' do
end
it 'configures sdn settings' do
should contain_neutron_plugin_ml2('sdn/token').with_value(params[:sdn_token]).with_secret(true)
should contain_neutron_plugin_ml2('sdn/password').with_value(params[:sdn_password]).with_secret(true)
should contain_neutron_plugin_ml2('sdn/username').with_value(params[:sdn_username])
should contain_neutron_plugin_ml2('sdn/url').with_value(params[:sdn_url])