Fix deprecated netapp option

"netapp_root_volume_name" is a deprecated
reference to "netapp_root_volume" and the
fallback path is being removed [1]

[1] https://review.opendev.org/745206/
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
Change-Id: I3891e8278c5b4a08d1baf435adede425498c3652
This commit is contained in:
Goutham Pacha Ravi 2020-08-11 16:03:03 -07:00
parent 23287bc88e
commit d338064529
5 changed files with 52 additions and 10 deletions

View File

@ -70,10 +70,10 @@
# (optional) Name of aggregate to create root volume on. This option only
# applies when the option driver_handles_share_servers is set to True.
#
# [*netapp_root_volume_name*]
# [*netapp_root_volume*]
# (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to root
# Defaults to $::os_service_default
#
# [*netapp_port_name_search_pattern*]
# (optional) Pattern for overriding the selection of network ports on which
@ -88,6 +88,14 @@
# [*package_ensure*]
# (optional) Ensure state for package. Defaults to 'present'.
#
#
# === DEPRECATED PARAMETERS
#
# [*netapp_root_volume_name*]
# (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to undef
#
# === Examples
#
# manila::backend::netapp { 'myBackend':
@ -114,10 +122,12 @@ define manila::backend::netapp (
$netapp_lif_name_template = 'os_%(net_allocation_id)s',
$netapp_aggregate_name_search_pattern = '(.*)',
$netapp_root_volume_aggregate = undef,
$netapp_root_volume_name = 'root',
$netapp_root_volume = $::os_service_default,
$netapp_port_name_search_pattern = '(.*)',
$netapp_trace_flags = undef,
$package_ensure = 'present',
# DEPRECATED PARAMETERS
$netapp_root_volume_name = undef,
) {
include manila::deps
@ -126,6 +136,12 @@ define manila::backend::netapp (
$netapp_share_driver = 'manila.share.drivers.netapp.common.NetAppDriver'
if $netapp_root_volume_name {
warning('The netapp_root_volume_name parameter is deprecated, use netapp_root_volume instead.')
}
$netapp_root_volume_real = pick($netapp_root_volume_name, $netapp_root_volume)
manila_config {
"${share_backend_name}/share_driver": value => $netapp_share_driver;
"${share_backend_name}/driver_handles_share_servers": value => $driver_handles_share_servers;
@ -142,7 +158,7 @@ define manila::backend::netapp (
"${share_backend_name}/netapp_lif_name_template": value => $netapp_lif_name_template;
"${share_backend_name}/netapp_aggregate_name_search_pattern": value => $netapp_aggregate_name_search_pattern;
"${share_backend_name}/netapp_root_volume_aggregate": value => $netapp_root_volume_aggregate;
"${share_backend_name}/netapp_root_volume_name": value => $netapp_root_volume_name;
"${share_backend_name}/netapp_root_volume": value => $netapp_root_volume_real;
"${share_backend_name}/netapp_port_name_search_pattern": value => $netapp_port_name_search_pattern;
"${share_backend_name}/netapp_trace_flags": value => $netapp_trace_flags;
}

View File

@ -64,10 +64,10 @@
# (optional) Name of aggregate to create root volume on. This option only
# applies when the option driver_handles_share_servers is set to True.
#
# [*netapp_root_volume_name*]
# [*netapp_root_volume*]
# (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to root
# Defaults to $::os_service_default
#
# [*netapp_port_name_search_pattern*]
# (optional) Pattern for overriding the selection of network ports on which
@ -79,6 +79,14 @@
# include method and api) that controls which trace info is written to the
# Manila logs when the debug level is set to True
#
#
# === DEPRECATED PARAMETERS
#
# [*netapp_root_volume_name*]
# (optional) Root volume name. This option only applies when the option
# driver_handles_share_servers is set to True.
# Defaults to undef
#
# === Examples
# class { 'manila::share::netapp':
# driver_handles_share_servers => true,
@ -103,11 +111,19 @@ class manila::share::netapp (
$netapp_lif_name_template = 'os_%(net_allocation_id)s',
$netapp_aggregate_name_search_pattern = '(.*)',
$netapp_root_volume_aggregate = undef,
$netapp_root_volume_name = 'root',
$netapp_root_volume = $::os_service_default,
$netapp_port_name_search_pattern = '(.*)',
$netapp_trace_flags = undef,
# DEPRECATED PARAMETERS
$netapp_root_volume_name = undef,
) {
if $netapp_root_volume_name {
warning('The netapp_root_volume_name parameter is deprecated, use netapp_root_volume instead.')
}
$netapp_root_volume_real = pick($netapp_root_volume_name, $netapp_root_volume)
manila::backend::netapp { 'DEFAULT':
driver_handles_share_servers => $driver_handles_share_servers,
netapp_login => $netapp_login,
@ -122,7 +138,7 @@ class manila::share::netapp (
netapp_lif_name_template => $netapp_lif_name_template,
netapp_aggregate_name_search_pattern => $netapp_aggregate_name_search_pattern,
netapp_root_volume_aggregate => $netapp_root_volume_aggregate,
netapp_root_volume_name => $netapp_root_volume_name,
netapp_root_volume => $netapp_root_volume_real,
netapp_port_name_search_pattern => $netapp_port_name_search_pattern,
netapp_trace_flags => $netapp_trace_flags,
}

View File

@ -0,0 +1,10 @@
---
deprecations:
- |
The parameter 'manila::backend::netapp::netapp_root_volume_name' has
been deprecated and replaced by 'manila::backend::netapp::netapp_root_volume'.
The older option will be removed in a future release.
- |
The parameter 'manila::share::netapp::netapp_root_volume_name' has
been deprecated and replaced by 'manila::share::netapp::netapp_root_volume'.
The older option will be removed in a future release.

View File

@ -23,7 +23,7 @@ describe 'manila::share::netapp' do
:netapp_vserver_name_template => 'os_%s',
:netapp_lif_name_template => 'os_%(net_allocation_id)s',
:netapp_aggregate_name_search_pattern => '(.*)',
:netapp_root_volume_name => 'root',
:netapp_root_volume => '<SERVICE DEFAULT>',
:netapp_port_name_search_pattern => '(.*)',
}
end

View File

@ -25,7 +25,7 @@ describe 'manila::backend::netapp' do
:netapp_vserver_name_template => 'os_%s',
:netapp_lif_name_template => 'os_%(net_allocation_id)s',
:netapp_aggregate_name_search_pattern => '(.*)',
:netapp_root_volume_name => 'root',
:netapp_root_volume => '<SERVICE DEFAULT>',
:netapp_port_name_search_pattern => '(.*)',
}
end