From b4ca842f181521a9798250c76bf740557100b0ea Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sat, 20 Apr 2024 22:19:53 +0900 Subject: [PATCH] Remove parameters for unsupported plugins Remove parameters for the following tempest plugins. Support for these plugins were deprecated[1] during the previous cycle. - ec2api-tempest-plugin - murano-tempest-plugin - sahara-tests [1] da173126db0be67f9bb3bf1f6c30c036eec75e0d Change-Id: Ib135a32304d26f98e430d739216984c948192a8c --- .../tempest_ec2_credentials/openstack.rb | 85 ------------------- lib/puppet/type/tempest_ec2_credentials.rb | 24 ------ manifests/init.pp | 66 -------------- ...in-cleanup-dalmetian-59478d5381b392fe.yaml | 15 ++++ 4 files changed, 15 insertions(+), 175 deletions(-) delete mode 100644 lib/puppet/provider/tempest_ec2_credentials/openstack.rb delete mode 100644 lib/puppet/type/tempest_ec2_credentials.rb create mode 100644 releasenotes/notes/plugin-cleanup-dalmetian-59478d5381b392fe.yaml diff --git a/lib/puppet/provider/tempest_ec2_credentials/openstack.rb b/lib/puppet/provider/tempest_ec2_credentials/openstack.rb deleted file mode 100644 index 7b03d397..00000000 --- a/lib/puppet/provider/tempest_ec2_credentials/openstack.rb +++ /dev/null @@ -1,85 +0,0 @@ -require File.join(File.dirname(__FILE__), '..','..','..', 'puppet/provider/tempest') - -Puppet::Type.type(:tempest_ec2_credentials).provide( - :openstack, - :parent => Puppet::Provider::Tempest -) do - - @credentials = Puppet::Provider::Openstack::CredentialsV3.new - - def exists? - access_found = false - secret_found = false - lines.each do |line| - l = line.chomp - if /^aws_access *=/ =~ l - access_found = true - end - if /^aws_secret *=/ =~ l - secret_found = true - end - end - access_found && secret_found - end - - def file_path - resource[:tempest_conf_path] - end - - def create - handle_create - end - - def destroy - handle_create - end - - def get_ec2_credentials - if resource[:ensure] == :present or resource[:ensure].nil? - if @ec2_credentials.nil? - @ec2_credentials = self.class.request('ec2 credentials', 'create', - ['--user', "#{resource[:user]}", - '--project', "#{resource[:project]}"], - file_path) - end - elsif resource[:ensure] != :absent - raise(Puppet::Error, "Cannot ensure to #{resource[:ensure]}") - end - @ec2_credentials - end - - def access_line - "aws_access = #{get_ec2_credentials[:access]}" - end - - def secret_line - "aws_secret = #{get_ec2_credentials[:secret]}" - end - - def conf_regex - /^\s*aws_(access|secret)\s*=\s*/ - end - - def handle_create() - file = lines - file.delete_if { |l| conf_regex.match(l) } - block_pos = file.find_index { |l| /^\[aws\]/ =~ l } - if block_pos.nil? - file += ["[aws]\n", "#{access_line}\n", "#{secret_line}\n"] - else - file.insert(block_pos+1, "#{access_line}\n", "#{secret_line}\n") - end - File.write(file_path, file.join) - end - - private - def lines - # If this type is ever used with very large files, we should - # write this in a different way, using a temp - # file; for now assuming that this type is only used on - # small-ish config files that can fit into memory without - # too much trouble. - @lines ||= File.readlines(file_path) - end - -end diff --git a/lib/puppet/type/tempest_ec2_credentials.rb b/lib/puppet/type/tempest_ec2_credentials.rb deleted file mode 100644 index 460b41c0..00000000 --- a/lib/puppet/type/tempest_ec2_credentials.rb +++ /dev/null @@ -1,24 +0,0 @@ -Puppet::Type.newtype(:tempest_ec2_credentials) do - - ensurable - - newparam(:name, :namevar => true) do - desc 'Name of the credentials. (DEPRECATED)' - end - - newparam(:user) do - desc 'Name of the user to create credentials for.' - end - - newparam(:project) do - desc 'Name of the project to create credentials in.' - end - - newparam(:tempest_conf_path) do - desc 'The path to tempest conf file.' - end - - autorequire(:package) do - ['python-openstackclient', 'python3-openstackclient'] - end -end diff --git a/manifests/init.pp b/manifests/init.pp index 5403c1d5..37c1e485 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -319,24 +319,6 @@ # Defaults to undef # [*login_url*] # Defaults to undef -# [*ec2api_available*] -# Defaults to undef -# [*ec2api_tester_roles*] -# Defaults to undef -# [*aws_ec2_url*] -# Defaults to undef -# [*aws_region*] -# Defaults to undef -# [*aws_image_id*] -# Defaults to undef -# [*aws_ebs_image_id*] -# Defaults to undef -# [*murano_available*] -# Defualts to undef -# [*sahara_available*] -# Defualts to undef -# [*sahara_plugins*] -# Defualts to undef # class tempest( $package_ensure = 'present', @@ -528,15 +510,6 @@ class tempest( $tempest_config_file = undef, $cli_dir = undef, $login_url = undef, - Optional[Boolean] $ec2api_available = undef, - Optional[Boolean] $murano_available = undef, - Optional[Boolean] $sahara_available = undef, - $ec2api_tester_roles = undef, - $aws_ec2_url = undef, - $aws_region = undef, - $aws_image_id = undef, - $aws_ebs_image_id = undef, - $sahara_plugins = undef, ) { [ 'glance_v2', 'cli_dir', 'login_url' ].each |String $deprecated_opt| { @@ -554,27 +527,6 @@ class tempest( } } - if $ec2api_available { - warning('EC2API support has been deprecated and has no effect now.') - } - if $murano_available { - warning('Murano support has been deprecated and has no effect now.') - } - if $sahara_available { - warning('Sahara support has been deprecated and has no effect now.') - } - - [ - 'ec2api_available', 'murano_available', 'sahara_available', - 'ec2api_tester_roles', 'aws_ec2_url', 'aws_region', - 'aws_image_id', 'aws_ebs_image_id', 'sahara_plugins' - ].each |String $deprecated_plugin_opt| { - if getvar($deprecated_plugin_opt) != undef { - warning("The ${deprecated_plugin_opt} parameter has been deprecated and has no effect.") - } - } - - include tempest::params include openstacklib::openstackclient @@ -816,24 +768,6 @@ class tempest( 'barbican_rbac_scope_verification/enforce_scope': ensure => absent; } - tempest_config { - # ec2api-tempest-plugin - 'service_available/ec2api': ensure => absent; - 'aws/ec2_url': ensure => absent; - 'aws/aws_region': ensure => absent; - 'aws/image_id': ensure => absent; - 'aws/ebs_image_id': ensure => absent; - 'aws/instance_type': ensure => absent; - 'aws/instance_type_alt': ensure => absent; - 'aws/aws_secret': ensure => absent; - 'aws/aws_access': ensure => absent; - # murano-tempest-plugin - 'service_available/murano': ensure => absent; - # sahara-tempest-plugin - 'service_available/sahara': ensure => absent; - 'data-processing-feature-enabled/plugins': ensure => absent; - } - oslo::concurrency { 'tempest_config': lock_path => $lock_path } oslo::log { 'tempest_config': diff --git a/releasenotes/notes/plugin-cleanup-dalmetian-59478d5381b392fe.yaml b/releasenotes/notes/plugin-cleanup-dalmetian-59478d5381b392fe.yaml new file mode 100644 index 00000000..4ab427e6 --- /dev/null +++ b/releasenotes/notes/plugin-cleanup-dalmetian-59478d5381b392fe.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + The following ``tempest`` class parameters have been removed. + + - ``ec2api_available`` + - ``murano_available`` + - ``sahara_available`` + - ``ec2api_tester_roles`` + - ``aws_ec2_url`` + - ``aws_region`` + - ``aws_image_id`` + - ``aws_ebs_image_id`` + - ``sahara_plugins`` +