From 2ae1115e4285d44d96386425f5d052df4c01ea7f Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 15 Feb 2021 23:05:00 +0900 Subject: [PATCH] Clean up remaining items for glance-registry This change drops remaining items about support for glance-registry. These were deprecated by the removal patch[1] which was merged during the previous cycle thus we are now ready to drop them. [1] 11599ba429459a9a192c1b7dfcf8ecf1fedc6ab3 Change-Id: If2d371a372cf4d95d84e3d71fb4ce272565ac659 --- README.md | 28 -------- .../glance_registry_config/ini_setting.rb | 10 --- .../glance_registry_paste_ini/ini_setting.rb | 10 --- lib/puppet/type/glance_registry_config.rb | 54 -------------- lib/puppet/type/glance_registry_paste_ini.rb | 53 -------------- manifests/api.pp | 51 ------------- manifests/config.pp | 19 ----- manifests/deps.pp | 2 - ...ve-registry-leftover-28913ae93b9934f8.yaml | 23 ++++++ .../ini_setting_spec.rb | 72 ------------------- .../ini_setting_spec.rb | 63 ---------------- spec/unit/type/glance_registry_config_spec.rb | 19 ----- .../type/glance_registry_paste_ini_spec.rb | 19 ----- 13 files changed, 23 insertions(+), 400 deletions(-) delete mode 100644 lib/puppet/provider/glance_registry_config/ini_setting.rb delete mode 100644 lib/puppet/provider/glance_registry_paste_ini/ini_setting.rb delete mode 100644 lib/puppet/type/glance_registry_config.rb delete mode 100644 lib/puppet/type/glance_registry_paste_ini.rb create mode 100644 releasenotes/notes/remove-registry-leftover-28913ae93b9934f8.yaml delete mode 100644 spec/unit/provider/glance_registry_config/ini_setting_spec.rb delete mode 100644 spec/unit/provider/glance_registry_paste_ini/ini_setting_spec.rb delete mode 100644 spec/unit/type/glance_registry_config_spec.rb delete mode 100644 spec/unit/type/glance_registry_paste_ini_spec.rb diff --git a/README.md b/README.md index 0db72d97..55b5c5a6 100644 --- a/README.md +++ b/README.md @@ -149,34 +149,6 @@ Whether to hide the value from Puppet logs. Defaults to `false`. If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `` -#### glance_registry_config (DEPRECATED) - -The `glance_registry_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/glance/glance-registry.conf` file. - -```puppet -glance_registry_config { 'DEFAULT/workers' : - value => 1, -} -``` - -This will write `workers=1` in the `[DEFAULT]` section. - -##### name - -Section/setting name to manage from `glance-registry.conf` - -##### value - -The value of the setting to be defined. - -##### secret - -Whether to hide the value from Puppet logs. Defaults to `false`. - -##### ensure_absent_val - -If value is equal to ensure_absent_val then the resource will behave as if `ensure => absent` was specified. Defaults to `` - #### glance_cache_config The `glance_cache_config` provider is a children of the ini_setting provider. It allows one to write an entry in the `/etc/glance/glance-cache.conf` file. diff --git a/lib/puppet/provider/glance_registry_config/ini_setting.rb b/lib/puppet/provider/glance_registry_config/ini_setting.rb deleted file mode 100644 index 8e9c54a7..00000000 --- a/lib/puppet/provider/glance_registry_config/ini_setting.rb +++ /dev/null @@ -1,10 +0,0 @@ -Puppet::Type.type(:glance_registry_config).provide( - :ini_setting, - :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) -) do - - def self.file_path - '/etc/glance/glance-registry.conf' - end - -end diff --git a/lib/puppet/provider/glance_registry_paste_ini/ini_setting.rb b/lib/puppet/provider/glance_registry_paste_ini/ini_setting.rb deleted file mode 100644 index 619eaee2..00000000 --- a/lib/puppet/provider/glance_registry_paste_ini/ini_setting.rb +++ /dev/null @@ -1,10 +0,0 @@ -Puppet::Type.type(:glance_registry_paste_ini).provide( - :ini_setting, - :parent => Puppet::Type.type(:openstack_config).provider(:ini_setting) -) do - - def self.file_path - '/etc/glance/glance-registry-paste.ini' - end - -end diff --git a/lib/puppet/type/glance_registry_config.rb b/lib/puppet/type/glance_registry_config.rb deleted file mode 100644 index bcd0912f..00000000 --- a/lib/puppet/type/glance_registry_config.rb +++ /dev/null @@ -1,54 +0,0 @@ -# DEPRECATED -Puppet::Type.newtype(:glance_registry_config) do - - ensurable - - newparam(:name, :namevar => true) do - desc 'Section/setting name to manage from glance-registry.conf' - newvalues(/\S+\/\S+/) - end - - newproperty(:value) do - desc 'The value of the setting to be defined.' - munge do |value| - value = value.to_s.strip - value.capitalize! if value =~ /^(true|false)$/i - value - end - newvalues(/^[\S ]*$/) - - def is_to_s( currentvalue ) - if resource.secret? - return '[old secret redacted]' - else - return currentvalue - end - end - - def should_to_s( newvalue ) - if resource.secret? - return '[new secret redacted]' - else - return newvalue - end - end - end - - newparam(:secret, :boolean => true) do - desc 'Whether to hide the value from Puppet logs. Defaults to `false`.' - - newvalues(:true, :false) - - defaultto false - end - - newparam(:ensure_absent_val) do - desc 'A value that is specified as the value property will behave as if ensure => absent was specified' - defaultto('') - end - - autorequire(:anchor) do - ['glance::install::end'] - end - -end diff --git a/lib/puppet/type/glance_registry_paste_ini.rb b/lib/puppet/type/glance_registry_paste_ini.rb deleted file mode 100644 index d3c12865..00000000 --- a/lib/puppet/type/glance_registry_paste_ini.rb +++ /dev/null @@ -1,53 +0,0 @@ -# DEPRECATED! -Puppet::Type.newtype(:glance_registry_paste_ini) do - - ensurable - - newparam(:name, :namevar => true) do - desc 'Section/setting name to manage from glance-registry-paste.ini' - newvalues(/\S+\/\S+/) - end - - newproperty(:value) do - desc 'The value of the setting to be defined.' - munge do |value| - value = value.to_s.strip - value.capitalize! if value =~ /^(true|false)$/i - value - end - - def is_to_s( currentvalue ) - if resource.secret? - return '[old secret redacted]' - else - return currentvalue - end - end - - def should_to_s( newvalue ) - if resource.secret? - return '[new secret redacted]' - else - return newvalue - end - end - end - - newparam(:secret, :boolean => true) do - desc 'Whether to hide the value from Puppet logs. Defaults to `false`.' - - newvalues(:true, :false) - - defaultto false - end - - newparam(:ensure_absent_val) do - desc 'A value that is specified as the value property will behave as if ensure => absent was specified' - defaultto('') - end - - autorequire(:anchor) do - ['glance::install::end'] - end - -end diff --git a/manifests/api.pp b/manifests/api.pp index 7a426fef..fd704f5c 100644 --- a/manifests/api.pp +++ b/manifests/api.pp @@ -265,32 +265,6 @@ # (optional) Sets the keystone region to use. # Defaults to undef # -# [*enable_v1_api*] -# (Optional) Enable or not Glance API v1. -# If you enable this option, you'll get a deprecation warning in Glance -# logs. If enable_v2_api is set to True, glance::registry::enable_v1_registry -# must be configured to True, since Registry is required in API v1. -# Defaults to undef -# -# [*enable_v2_api*] -# (Optional) Enable or not Glance API v2. -# Defaults to undef -# -# [*registry_client_cert_file*] -# (optional) The path to the cert file to use in SSL connections to the -# registry server. -# Defaults to undef -# -# [*registry_client_key_file*] -# (optional) The path to the private key file to use in SSL connections to the -# registry server. -# Defaults to undef -# -# [*registry_client_ca_file*] -# (optional) The path to the CA certificate file to use in SSL connections to the -# registry server. -# Defaults to undef -# # [*database_connection*] # (optional) Connection url to connect to glance database. # Defaults to undef @@ -374,11 +348,6 @@ class glance::api( $show_multiple_locations = undef, $database_min_pool_size = undef, $os_region_name = undef, - $enable_v1_api = undef, - $enable_v2_api = undef, - $registry_client_cert_file = undef, - $registry_client_key_file = undef, - $registry_client_ca_file = undef, $database_connection = undef, $database_idle_timeout = undef, $database_max_pool_size = undef, @@ -396,26 +365,6 @@ class glance::api( cinder::backend::multistore::cinder::cinder_os_region_name instead.') } - if $registry_client_cert_file != undef { - warning('glance::api::registry_client_cert_file is deprecated and has no effect') - } - - if $registry_client_key_file != undef { - warning('glance::api::registry_client_key_file is deprecated and has no effect') - } - - if $registry_client_ca_file != undef { - warning('glance::api::registry_client_ca_file is deprecated and has no effect') - } - - if $enable_v1_api != undef { - warning('The glance::api::enable_v1_api parameter was deprecated and has no effect.') - } - - if $enable_v2_api != undef { - warning('The glance::api::enable_v2_api parameter was deprecated and has no effect.') - } - if $database_connection != undef { warning('The database_connection parameter is deprecated and will be \ removed in a future realse. Use glance::api::db::database_connection instead') diff --git a/manifests/config.pp b/manifests/config.pp index c1549158..33db98ac 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -29,14 +29,6 @@ # [*image_import_config*] # (optional) Allow configuration of glance-image-import.conf configurations. # -# DEPRECATED PARAMETERS -# -# [*registry_config*] -# (optional) Allow configuration of glance-registry.conf configurations. -# -# [*registry_paste_ini_config*] -# (optional) Allow configuration of glance-registry-paste.ini configurations. -# # NOTE: The configuration MUST NOT be already handled by this module # or Puppet catalog compilation will fail with duplicate resources. # @@ -45,21 +37,10 @@ class glance::config ( $api_paste_ini_config = {}, $cache_config = {}, $image_import_config = {}, - # DEPRECATED PARAMETERS - $registry_config = undef, - $registry_paste_ini_config = undef, ) { include glance::deps - if $registry_config != undef { - warning('glance::config::registry_config is deprecated and has no effect') - } - - if $registry_paste_ini_config != undef { - warning('glance::config::registry_paste_ini_config is deprecated and has no effect') - } - validate_legacy(Hash, 'validate_hash', $api_config) validate_legacy(Hash, 'validate_hash', $api_paste_ini_config) validate_legacy(Hash, 'validate_hash', $cache_config) diff --git a/manifests/deps.pp b/manifests/deps.pp index 4a1b9a39..a604b056 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -41,8 +41,6 @@ class glance::deps { Anchor['glance::config::begin'] -> Glance_api_paste_ini<||> ~> Anchor['glance::config::end'] Anchor['glance::config::begin'] -> Glance_cache_config<||> ~> Anchor['glance::config::end'] Anchor['glance::config::begin'] -> Glance_image_import_config<||> ~> Anchor['glance::config::end'] - Anchor['glance::config::begin'] -> Glance_registry_config<||> ~> Anchor['glance::config::end'] - Anchor['glance::config::begin'] -> Glance_registry_paste_ini<||> ~> Anchor['glance::config::end'] Anchor['glance::config::begin'] -> Glance_swift_config<||> ~> Anchor['glance::config::end'] # Support packages need to be installed in the install phase, but we don't diff --git a/releasenotes/notes/remove-registry-leftover-28913ae93b9934f8.yaml b/releasenotes/notes/remove-registry-leftover-28913ae93b9934f8.yaml new file mode 100644 index 00000000..eb9ca38a --- /dev/null +++ b/releasenotes/notes/remove-registry-leftover-28913ae93b9934f8.yaml @@ -0,0 +1,23 @@ +--- +upgrade: + - | + The following parameters have been removed from the ``glance::api`` class. + + - ``enable_v1_api`` + - ``enable_v2_api`` + - ``registry_client_cert_file`` + - ``registry_client_key_file`` + - ``registry_client_ca_file`` + + - | + The following parameters have been removed from the ``glance::config`` + class. + + - ``registry_config`` + - ``registry_paste_ini_config`` + + - | + The following resource types have been removed. + + - ``glance_registry_config`` + - ``glance_registry_paste_ini`` diff --git a/spec/unit/provider/glance_registry_config/ini_setting_spec.rb b/spec/unit/provider/glance_registry_config/ini_setting_spec.rb deleted file mode 100644 index a05e0f2a..00000000 --- a/spec/unit/provider/glance_registry_config/ini_setting_spec.rb +++ /dev/null @@ -1,72 +0,0 @@ -$LOAD_PATH.push( - File.join( - File.dirname(__FILE__), - '..', - '..', - '..', - 'fixtures', - 'modules', - 'inifile', - 'lib') -) -$LOAD_PATH.push( - File.join( - File.dirname(__FILE__), - '..', - '..', - '..', - 'fixtures', - 'modules', - 'openstacklib', - 'lib') -) - -require 'spec_helper' - -provider_class = Puppet::Type.type(:glance_registry_config).provider(:ini_setting) - -describe provider_class do - - it 'should default to the default setting when no other one is specified' do - resource = Puppet::Type::Glance_registry_config.new( - { - :name => 'DEFAULT/foo', - :value => 'bar' - } - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('DEFAULT') - expect(provider.setting).to eq('foo') - end - - it 'should allow setting to be set explicitly' do - resource = Puppet::Type::Glance_registry_config.new( - { - :name => 'dude/foo', - :value => 'bar' - } - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('dude') - expect(provider.setting).to eq('foo') - end - - it 'should ensure absent when is specified as a value' do - resource = Puppet::Type::Glance_registry_config.new( - {:name => 'dude/foo', :value => ''} - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end - - it 'should ensure absent when value matches ensure_absent_val' do - resource = Puppet::Type::Glance_registry_config.new( - {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end - -end diff --git a/spec/unit/provider/glance_registry_paste_ini/ini_setting_spec.rb b/spec/unit/provider/glance_registry_paste_ini/ini_setting_spec.rb deleted file mode 100644 index 670f6737..00000000 --- a/spec/unit/provider/glance_registry_paste_ini/ini_setting_spec.rb +++ /dev/null @@ -1,63 +0,0 @@ -$LOAD_PATH.push( - File.join( - File.dirname(__FILE__), - '..', - '..', - '..', - 'fixtures', - 'modules', - 'inifile', - 'lib') -) -$LOAD_PATH.push( - File.join( - File.dirname(__FILE__), - '..', - '..', - '..', - 'fixtures', - 'modules', - 'openstacklib', - 'lib') -) -require 'spec_helper' -provider_class = Puppet::Type.type(:glance_registry_paste_ini).provider(:ini_setting) -describe provider_class do - - it 'should default to the default setting when no other one is specified' do - resource = Puppet::Type::Glance_registry_paste_ini.new( - {:name => 'DEFAULT/foo', :value => 'bar'} - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('DEFAULT') - expect(provider.setting).to eq('foo') - end - - it 'should allow setting to be set explicitly' do - resource = Puppet::Type::Glance_registry_paste_ini.new( - {:name => 'dude/whoa', :value => 'bar'} - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('dude') - expect(provider.setting).to eq('whoa') - end - - it 'should ensure absent when is specified as a value' do - resource = Puppet::Type::Glance_registry_paste_ini.new( - {:name => 'dude/foo', :value => ''} - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end - - it 'should ensure absent when value matches ensure_absent_val' do - resource = Puppet::Type::Glance_registry_paste_ini.new( - {:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' } - ) - provider = provider_class.new(resource) - provider.exists? - expect(resource[:ensure]).to eq :absent - end - -end \ No newline at end of file diff --git a/spec/unit/type/glance_registry_config_spec.rb b/spec/unit/type/glance_registry_config_spec.rb deleted file mode 100644 index c4d1618a..00000000 --- a/spec/unit/type/glance_registry_config_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'puppet' -require 'puppet/type/glance_registry_config' - -describe 'Puppet::Type.type(:glance_registry_config)' do - before :each do - @glance_registry_config = Puppet::Type.type(:glance_registry_config).new(:name => 'DEFAULT/foo', :value => 'bar') - end - - it 'should autorequire the package that install the file' do - catalog = Puppet::Resource::Catalog.new - anchor = Puppet::Type.type(:anchor).new(:name => 'glance::install::end') - catalog.add_resource anchor, @glance_registry_config - dependency = @glance_registry_config.autorequire - expect(dependency.size).to eq(1) - expect(dependency[0].target).to eq(@glance_registry_config) - expect(dependency[0].source).to eq(anchor) - end - -end diff --git a/spec/unit/type/glance_registry_paste_ini_spec.rb b/spec/unit/type/glance_registry_paste_ini_spec.rb deleted file mode 100644 index f6039f8e..00000000 --- a/spec/unit/type/glance_registry_paste_ini_spec.rb +++ /dev/null @@ -1,19 +0,0 @@ -require 'puppet' -require 'puppet/type/glance_registry_paste_ini' - -describe 'Puppet::Type.type(:glance_registry_paste_ini)' do - before :each do - @glance_registry_paste_ini = Puppet::Type.type(:glance_registry_paste_ini).new(:name => 'DEFAULT/foo', :value => 'bar') - end - - it 'should autorequire the package that install the file' do - catalog = Puppet::Resource::Catalog.new - anchor = Puppet::Type.type(:anchor).new(:name => 'glance::install::end') - catalog.add_resource anchor, @glance_registry_paste_ini - dependency = @glance_registry_paste_ini.autorequire - expect(dependency.size).to eq(1) - expect(dependency[0].target).to eq(@glance_registry_paste_ini) - expect(dependency[0].source).to eq(anchor) - end - -end