From ecda22e1eefad20ee570e84dd975311d0e9b4e17 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Fri, 18 Apr 2025 12:04:19 +0900 Subject: [PATCH] Remove support for backend options in [DEFAULT] section These were deprecated during the previous cycle[1] or earlier, because these backend options should be configured in the dedicated sections for individual backends. [1] 585dfd182e05775ced405ac4b470f41a397016dc Change-Id: Id60fb7959c639977b59f9a3611c799761f440785 --- manifests/share/generic.pp | 106 -------------- manifests/share/glusterfs.pp | 32 ----- manifests/share/hitachi_hnas.pp | 68 --------- manifests/share/netapp.pp | 133 ------------------ ...default-backend-opts-b87e888a7b3cc6a7.yaml | 9 ++ spec/classes/manila_share_generic_spec.rb | 85 ----------- spec/classes/manila_share_glusterfs_spec.rb | 34 ----- .../classes/manila_share_hitachi_hnas_spec.rb | 42 ------ spec/classes/manila_share_netapp_spec.rb | 72 ---------- 9 files changed, 9 insertions(+), 572 deletions(-) delete mode 100644 manifests/share/generic.pp delete mode 100644 manifests/share/glusterfs.pp delete mode 100644 manifests/share/hitachi_hnas.pp delete mode 100644 manifests/share/netapp.pp create mode 100644 releasenotes/notes/remove-default-backend-opts-b87e888a7b3cc6a7.yaml delete mode 100644 spec/classes/manila_share_generic_spec.rb delete mode 100644 spec/classes/manila_share_glusterfs_spec.rb delete mode 100644 spec/classes/manila_share_hitachi_hnas_spec.rb delete mode 100644 spec/classes/manila_share_netapp_spec.rb diff --git a/manifests/share/generic.pp b/manifests/share/generic.pp deleted file mode 100644 index 1d49e3c5..00000000 --- a/manifests/share/generic.pp +++ /dev/null @@ -1,106 +0,0 @@ -# == Class: manila::share::generic -# -# DEPRECATED !! -# Configures Manila to use the generic share driver -# -# ===Parameters -# [*driver_handles_share_servers*] -# (required) Denotes whether the driver should handle the responsibility of -# managing share servers. This must be set to false if the driver is to -# operate without managing share servers. -# -# [*smb_template_config_path*] -# (optional) Path to smb config. -# Defaults to $facts['os_service_default'] -# -# [*volume_name_template*] -# (optional) Volume name template. -# Defaults to $facts['os_service_default'] -# -# [*volume_snapshot_name_template*] -# (optional) Volume snapshot name template. -# Defaults to $facts['os_service_default'] -# -# [*share_mount_path*] -# (optional) Parent path in service instance where shares will be mounted. -# Defaults to $facts['os_service_default'] -# -# [*max_time_to_create_volume*] -# (optional) Maximum time to wait for creating cinder volume. -# Defaults to $facts['os_service_default'] -# -# [*max_time_to_attach*] -# (optional) Maximum time to wait for attaching cinder volume. -# Defaults to $facts['os_service_default'] -# -# [*service_instance_smb_config_path*] -# (optional) Path to smb config in service instance. -# Defaults to $facts['os_service_default'] -# -# [*share_volume_fstype*] -# (optional) Filesystem type of the share volume. -# Choices: 'ext4', 'ext3' -# Defaults to $facts['os_service_default'] -# -# [*share_helpers*] -# (optional) Specify list of share export helpers. -# Defaults to $facts['os_service_default'] -# -# [*cinder_volume_type*] -# (optional) Name or id of cinder volume type which will be used for all -# volumes created by driver. -# Defaults to $facts['os_service_default'] -# -# [*delete_share_server_with_last_share*] -# (optional) With this option is set to True share server will be deleted -# on deletion of last share. -# Defaults to $facts['os_service_default'] -# -# [*unmanage_remove_access_rules*] -# (optional) If set to True, then manila will deny access and remove all -# access rules on share unmanage. If set to False - nothing will be changed. -# Defaults to $facts['os_service_default'] -# -# [*automatic_share_server_cleanup*] -# (optional) If set to True, then Manila will delete all share servers which -# were unused more than specified time. If set to False, automatic deletion -# of share servers will be disabled. -# Defaults to $facts['os_service_default'] -# -class manila::share::generic ( - $driver_handles_share_servers, - $smb_template_config_path = $facts['os_service_default'], - $volume_name_template = $facts['os_service_default'], - $volume_snapshot_name_template = $facts['os_service_default'], - $share_mount_path = $facts['os_service_default'], - $max_time_to_create_volume = $facts['os_service_default'], - $max_time_to_attach = $facts['os_service_default'], - $service_instance_smb_config_path = $facts['os_service_default'], - $share_volume_fstype = $facts['os_service_default'], - $share_helpers = $facts['os_service_default'], - $cinder_volume_type = $facts['os_service_default'], - $delete_share_server_with_last_share = $facts['os_service_default'], - $unmanage_remove_access_rules = $facts['os_service_default'], - $automatic_share_server_cleanup = $facts['os_service_default'], -) { - - warning("The manila::share::generic class is deprecated. \ -Use the manila::backend::generic defined resource type.") - - manila::backend::generic { 'DEFAULT': - driver_handles_share_servers => $driver_handles_share_servers, - smb_template_config_path => $smb_template_config_path, - volume_name_template => $volume_name_template, - volume_snapshot_name_template => $volume_snapshot_name_template, - share_mount_path => $share_mount_path, - max_time_to_create_volume => $max_time_to_create_volume, - max_time_to_attach => $max_time_to_attach, - service_instance_smb_config_path => $service_instance_smb_config_path, - share_helpers => $share_helpers, - share_volume_fstype => $share_volume_fstype, - cinder_volume_type => $cinder_volume_type, - delete_share_server_with_last_share => $delete_share_server_with_last_share, - unmanage_remove_access_rules => $unmanage_remove_access_rules, - automatic_share_server_cleanup => $automatic_share_server_cleanup, - } -} diff --git a/manifests/share/glusterfs.pp b/manifests/share/glusterfs.pp deleted file mode 100644 index 71bdd079..00000000 --- a/manifests/share/glusterfs.pp +++ /dev/null @@ -1,32 +0,0 @@ -# == Class: manila::share::glusterfs -# -# DEPRECATED !! -# Configures Manila to use GlusterFS as a share driver -# -# === Parameters -# -# [*glusterfs_volumes_config*] -# (required) File with the list of Gluster volumes that can -# be used to create shares -# -# [*glusterfs_mount_point_base*] -# Base dir containing mount points for Gluster volumes. -# -# === Examples -# -# class { 'manila::share::glusterfs': -# glusterfs_shares = ['192.168.1.1:/shares'], -# } -# -class manila::share::glusterfs ( - $glusterfs_volumes_config = '/etc/manila/glusterfs_volumes', - $glusterfs_mount_point_base = '$state_path/mnt', -) { - - warning('Support for GlusterFS driver has been deprecated.') - - manila::backend::glusterfs { 'DEFAULT': - glusterfs_volumes_config => $glusterfs_volumes_config, - glusterfs_mount_point_base => $glusterfs_mount_point_base, - } -} diff --git a/manifests/share/hitachi_hnas.pp b/manifests/share/hitachi_hnas.pp deleted file mode 100644 index 7528dcda..00000000 --- a/manifests/share/hitachi_hnas.pp +++ /dev/null @@ -1,68 +0,0 @@ -# == Class: manila::share::hitachi_hnas -# -# DEPRECATED !! -# Configures Manila to use the HITACHI NAS platform share driver -# -# === Parameters -# -# [*hitachi_hnas_user*] -# (required) Denotes the username credential used to manage HNAS through -# management interface. -# -# [*hitachi_hnas_password*] -# (required) Denotes the password credential used to manage HNAS through -# management interface. -# -# [*hitachi_hnas_ip*] -# (required) Denotes the IP address used to access HNAS through management -# interface. -# -# [*hitachi_hnas_evs_id*] -# (required) Denotes the identification number of the HNAS EVS data interface -# -# [*hitachi_hnas_evs_ip*] -# (required) Denotes the IP address of the HNAS EVS data interface -# -# [*hitachi_hnas_file_system_name*] -# (required) Denotes the hnas filesystem name used for volume provisioning -# -# [*driver_handles_share_servers*] -# (optional) Denotes whether the driver should handle the responsibility of -# managing share servers. -# Defaults to false. -# -# === Examples -# -# class { 'manila::share::hds_hnas': -# driver_handles_share_servers => false, -# hitachi_hnas_user => 'supervisor', -# hitachi_hnas_password => 'supervisor', -# hitachi_hnas_ip => '172.24.44.15', -# hitachi_hnas_evs_id => '1', -# hitachi_hnas_evs_ip => '10.0.1.20', -# hitachi_hnas_file_system_name => 'FS-Manila', -# } -# -class manila::share::hitachi_hnas ( - $hitachi_hnas_user, - $hitachi_hnas_password, - $hitachi_hnas_ip, - $hitachi_hnas_evs_id, - $hitachi_hnas_evs_ip, - $hitachi_hnas_file_system_name, - $driver_handles_share_servers = false, -) { - - warning("The manila::share::hitachi_hnas class is deprecated. \ -Use the manila::backend::hitachi_hnas defined resource type.") - - manila::backend::hitachi_hnas { 'DEFAULT': - driver_handles_share_servers => $driver_handles_share_servers, - hitachi_hnas_user => $hitachi_hnas_user, - hitachi_hnas_password => $hitachi_hnas_password, - hitachi_hnas_ip => $hitachi_hnas_ip, - hitachi_hnas_evs_id => $hitachi_hnas_evs_id, - hitachi_hnas_evs_ip => $hitachi_hnas_evs_ip, - hitachi_hnas_file_system_name => $hitachi_hnas_file_system_name, - } -} diff --git a/manifests/share/netapp.pp b/manifests/share/netapp.pp deleted file mode 100644 index c15204ca..00000000 --- a/manifests/share/netapp.pp +++ /dev/null @@ -1,133 +0,0 @@ -# == Class: manila::share::netapp -# -# DEPRECATED !! -# Configures Manila to use the NetApp share driver -# -# === Parameters -# [*driver_handles_share_servers*] -# (required) Denotes whether the driver should handle the responsibility of -# managing share servers. This must be set to false if the driver is to -# operate without managing share servers. -# -# [*netapp_login*] -# (required) Administrative user account name used to access the storage -# system. -# -# [*netapp_password*] -# (required) Password for the administrative user account specified in the -# netapp_login parameter. -# -# [*netapp_server_hostname*] -# (required) The hostname (or IP address) for the storage system. -# -# [*netapp_transport_type*] -# (optional) The transport protocol used when communicating with -# the storage system or proxy server. Valid values are -# http or https. -# Defaults to http -# -# [*netapp_storage_family*] -# (optional) The storage family type used on the storage system; valid -# values are ontap_cluster for clustered Data ONTAP. -# Defaults to ontap_cluster -# -# [*netapp_server_port*] -# (optional) The TCP port to use for communication with the storage system -# or proxy server. If not specified, Data ONTAP drivers will use 80 for HTTP -# and 443 for HTTPS. -# -# [*netapp_volume_name_template*] -# (optional) NetApp volume name template. -# Defaults to share_%(share_id)s -# -# [*netapp_vserver*] -# (optional) This option specifies the storage virtual machine (previously -# called a Vserver) name on the storage cluster on which provisioning of -# shared file systems should occur. This option only applies -# when the option driver_handles_share_servers is set to False. -# -# [*netapp_vserver_name_template*] -# (optional) Name template to use for new vserver. This option only applies -# when the option driver_handles_share_servers is set to True. -# Defaults to os_%s -# -# [*netapp_lif_name_template*] -# (optional) Logical interface (LIF) name template. This option only applies -# when the option driver_handles_share_servers is set to True. -# Defaults to os_%(net_allocation_id)s -# -# [*netapp_aggregate_name_search_pattern*] -# (optional) Pattern for searching available aggregates -# for provisioning. -# Defaults to (.*) -# -# [*netapp_root_volume_aggregate*] -# (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*] -# (optional) Root volume name. This option only applies when the option -# driver_handles_share_servers is set to True. -# Defaults to $facts['os_service_default'] -# -# [*netapp_port_name_search_pattern*] -# (optional) Pattern for overriding the selection of network ports on which -# to create Vserver LIFs. -# Defaults to (.*) -# -# [*netapp_trace_flags*] -# (optional) This option is a comma-separated list of options (valid values -# include method and api) that controls which trace info is written to the -# Manila logs when the debug level is set to True -# -# === Examples -# class { 'manila::share::netapp': -# driver_handles_share_servers => true, -# netapp_login => 'clusterAdmin', -# netapp_password => 'password', -# netapp_server_hostname => 'netapp.mycorp.com', -# netapp_storage_family => 'ontap_cluster', -# netapp_transport_type => 'https', -# } -# -class manila::share::netapp ( - $driver_handles_share_servers, - $netapp_login, - $netapp_password, - $netapp_server_hostname, - $netapp_transport_type = 'http', - $netapp_storage_family = 'ontap_cluster', - $netapp_server_port = undef, - $netapp_volume_name_template = 'share_%(share_id)s', - $netapp_vserver = undef, - $netapp_vserver_name_template = 'os_%s', - $netapp_lif_name_template = 'os_%(net_allocation_id)s', - $netapp_aggregate_name_search_pattern = '(.*)', - $netapp_root_volume_aggregate = undef, - $netapp_root_volume = $facts['os_service_default'], - $netapp_port_name_search_pattern = '(.*)', - $netapp_trace_flags = undef, -) { - - warning("The manila::share::netapp class is deprecated. \ -Use the manila::backend::netapp defined resource type.") - - manila::backend::netapp { 'DEFAULT': - driver_handles_share_servers => $driver_handles_share_servers, - netapp_login => $netapp_login, - netapp_password => $netapp_password, - netapp_server_hostname => $netapp_server_hostname, - netapp_transport_type => $netapp_transport_type, - netapp_storage_family => $netapp_storage_family, - netapp_server_port => $netapp_server_port, - netapp_volume_name_template => $netapp_volume_name_template, - netapp_vserver => $netapp_vserver, - netapp_vserver_name_template => $netapp_vserver_name_template, - 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 => $netapp_root_volume, - netapp_port_name_search_pattern => $netapp_port_name_search_pattern, - netapp_trace_flags => $netapp_trace_flags, - } -} diff --git a/releasenotes/notes/remove-default-backend-opts-b87e888a7b3cc6a7.yaml b/releasenotes/notes/remove-default-backend-opts-b87e888a7b3cc6a7.yaml new file mode 100644 index 00000000..895adcac --- /dev/null +++ b/releasenotes/notes/remove-default-backend-opts-b87e888a7b3cc6a7.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + The following classes have been removed. + + - ``manila::share::generic`` + - ``manila::share::glusterfs`` + - ``manila::share::hitachi_hnas`` + - ``manila::share::netapp`` diff --git a/spec/classes/manila_share_generic_spec.rb b/spec/classes/manila_share_generic_spec.rb deleted file mode 100644 index 733ceafa..00000000 --- a/spec/classes/manila_share_generic_spec.rb +++ /dev/null @@ -1,85 +0,0 @@ -require 'spec_helper' - -describe 'manila::share::generic' do - let :params do - { - :driver_handles_share_servers => true, - } - end - - shared_examples_for 'manila::share::generic' do - context 'with default value' do - it 'configures generic share driver' do - is_expected.to contain_manila_config('DEFAULT/share_driver').with_value( - 'manila.share.drivers.generic.GenericShareDriver') - is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value('') - is_expected.to contain_manila_config('DEFAULT/smb_template_config_path').with_value('') - is_expected.to contain_manila_config('DEFAULT/volume_name_template').with_value('') - is_expected.to contain_manila_config('DEFAULT/volume_snapshot_name_template').with_value('') - is_expected.to contain_manila_config('DEFAULT/share_mount_path').with_value('') - is_expected.to contain_manila_config('DEFAULT/max_time_to_create_volume').with_value('') - is_expected.to contain_manila_config('DEFAULT/max_time_to_attach').with_value('') - is_expected.to contain_manila_config('DEFAULT/service_instance_smb_config_path').with_value('') - is_expected.to contain_manila_config('DEFAULT/share_volume_fstype').with_value('') - is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value('') - is_expected.to contain_manila_config('DEFAULT/cinder_volume_type').with_value('') - is_expected.to contain_manila_config('DEFAULT/delete_share_server_with_last_share').with_value('') - is_expected.to contain_manila_config('DEFAULT/unmanage_remove_access_rules').with_value('') - is_expected.to contain_manila_config('DEFAULT/automatic_share_server_cleanup').with_value('') - end - end - - context 'with parameters' do - before :each do - params.merge!({ - :smb_template_config_path => '$state_path/smb.conf', - :volume_name_template => 'manila-share-%s', - :volume_snapshot_name_template => 'manila-snapshot-%s', - :share_mount_path => '/shares', - :max_time_to_create_volume => 180, - :max_time_to_attach => 120, - :service_instance_smb_config_path => '$share_mount_path/smb.conf', - :share_volume_fstype => 'ext4', - :share_helpers => 'NFS=manila.share.drivers.helpers.NFSHelper', - :cinder_volume_type => 'gold', - :delete_share_server_with_last_share => 'True', - :unmanage_remove_access_rules => 'True', - :automatic_share_server_cleanup => 'False', - }) - end - - it 'configures generic share driver' do - params.each_pair do |config,value| - is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value ) - end - end - end - - context 'with array value' do - before :each do - params.merge!({ - :share_helpers => [ - 'CIFS=manila.share.drivers.helpers.CIFSHelperIPAccess', - 'NFS=manila.share.drivers.helpers.NFSHelper' - ] - }) - end - it 'configures generic share driver' do - is_expected.to contain_manila_config('DEFAULT/share_helpers').with_value( - 'CIFS=manila.share.drivers.helpers.CIFSHelperIPAccess,'\ - 'NFS=manila.share.drivers.helpers.NFSHelper') - end - end - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge!(OSDefaults.get_facts()) - end - it_behaves_like 'manila::share::generic' - end - end -end diff --git a/spec/classes/manila_share_glusterfs_spec.rb b/spec/classes/manila_share_glusterfs_spec.rb deleted file mode 100644 index 146506a7..00000000 --- a/spec/classes/manila_share_glusterfs_spec.rb +++ /dev/null @@ -1,34 +0,0 @@ -require 'spec_helper' - -describe 'manila::share::glusterfs' do - - shared_examples_for 'glusterfs share driver' do - let :params do - { - :glusterfs_volumes_config => '/etc/manila/glusterfs_volumes', - :glusterfs_mount_point_base => '$state_path/mnt', - } - end - - it 'configures glusterfs share driver' do - is_expected.to contain_manila_config('DEFAULT/share_driver').with_value( - 'manila.share.drivers.glusterfs.GlusterfsShareDriver') - is_expected.to contain_manila_config('DEFAULT/glusterfs_volumes_config').with_value( - '/etc/manila/glusterfs_volumes') - is_expected.to contain_manila_config('DEFAULT/glusterfs_mount_point_base').with_value( - '$state_path/mnt') - end - - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge!(OSDefaults.get_facts()) - end - it_behaves_like 'glusterfs share driver' - end - end -end diff --git a/spec/classes/manila_share_hitachi_hnas_spec.rb b/spec/classes/manila_share_hitachi_hnas_spec.rb deleted file mode 100644 index 87277c58..00000000 --- a/spec/classes/manila_share_hitachi_hnas_spec.rb +++ /dev/null @@ -1,42 +0,0 @@ -require 'spec_helper' - -describe 'manila::share::hitachi_hnas' do - - let :params do - { - :driver_handles_share_servers => false, - :hitachi_hnas_ip => '172.24.44.15', - :hitachi_hnas_user => 'supervisor', - :hitachi_hnas_password => 'supervisor', - :hitachi_hnas_evs_id => '1', - :hitachi_hnas_evs_ip => ' 172.24.53.1', - :hitachi_hnas_file_system_name => 'FS-Manila', - } - end - - shared_examples_for 'hitachi hnas share driver' do - it 'configures hitachi nas share driver' do - is_expected.to contain_manila_config("DEFAULT/share_driver").with_value( - 'manila.share.drivers.hitachi.hds_hnas.HDSHNASDriver') - params.each_pair do |config,value| - is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value ) - end - end - - it 'marks hitachi_hnas_password as secret' do - is_expected.to contain_manila_config("DEFAULT/hitachi_hnas_password").with_secret( true ) - end - end - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge(OSDefaults.get_facts()) - end - - it_configures 'hitachi hnas share driver' - end - end -end diff --git a/spec/classes/manila_share_netapp_spec.rb b/spec/classes/manila_share_netapp_spec.rb deleted file mode 100644 index 59677bed..00000000 --- a/spec/classes/manila_share_netapp_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -require 'spec_helper' - -describe 'manila::share::netapp' do - - let :params do - { - :driver_handles_share_servers => true, - :netapp_login => 'netapp', - :netapp_password => 'password', - :netapp_server_hostname => '127.0.0.2', - :netapp_server_port => '443', - :netapp_vserver => 'manilasvm', - :netapp_root_volume_aggregate => 'aggr1', - :netapp_trace_flags => 'method,api', - } - end - - let :default_params do - { - :netapp_transport_type => 'http', - :netapp_storage_family => 'ontap_cluster', - :netapp_volume_name_template => 'share_%(share_id)s', - :netapp_vserver_name_template => 'os_%s', - :netapp_lif_name_template => 'os_%(net_allocation_id)s', - :netapp_aggregate_name_search_pattern => '(.*)', - :netapp_root_volume => '', - :netapp_port_name_search_pattern => '(.*)', - } - end - - - shared_examples_for 'netapp share driver' do - let :params_hash do - default_params.merge(params) - end - - it 'configures netapp share driver' do - is_expected.to contain_manila_config('DEFAULT/share_driver').with_value( - 'manila.share.drivers.netapp.common.NetAppDriver') - params_hash.each_pair do |config,value| - is_expected.to contain_manila_config("DEFAULT/#{config}").with_value( value ) - end - end - - it 'marks netapp_password as secret' do - is_expected.to contain_manila_config('DEFAULT/netapp_password').with_secret( true ) - end - end - - - on_supported_os({ - :supported_os => OSDefaults.get_supported_os - }).each do |os,facts| - context "on #{os}" do - let (:facts) do - facts.merge!(OSDefaults.get_facts()) - end - context 'with default parameters' do - before do - params = {} - end - - it_configures 'netapp share driver' - end - - context 'with provided parameters' do - it_configures 'netapp share driver' - end - end - end - -end