diff --git a/lib/puppet/provider/ironic_api_paste_ini/ini_setting.rb b/lib/puppet/provider/ironic_api_paste_ini/ini_setting.rb deleted file mode 100644 index a43fb762..00000000 --- a/lib/puppet/provider/ironic_api_paste_ini/ini_setting.rb +++ /dev/null @@ -1,27 +0,0 @@ -Puppet::Type.type(:ironic_api_paste_ini).provide( - :ini_setting, - :parent => Puppet::Type.type(:ini_setting).provider(:ruby) -) do - - def section - resource[:name].split('/', 2).first - end - - def setting - resource[:name].split('/', 2).last - end - - def separator - '=' - end - - def self.file_path - '/etc/ironic/api-paste.ini' - end - - # added for backwards compatibility with older versions of inifile - def file_path - self.class.file_path - end - -end diff --git a/lib/puppet/type/ironic_api_paste_ini.rb b/lib/puppet/type/ironic_api_paste_ini.rb deleted file mode 100644 index 40447863..00000000 --- a/lib/puppet/type/ironic_api_paste_ini.rb +++ /dev/null @@ -1,52 +0,0 @@ -Puppet::Type.newtype(:ironic_api_paste_ini) do - - ensurable - - newparam(:name, :namevar => true) do - desc 'Section/setting name to manage from /etc/ironic/api-paste.ini (DEPRECATED!)' - 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 - ['ironic::install::end'] - end - -end diff --git a/manifests/config.pp b/manifests/config.pp index 94ac1dcf..437526f6 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -17,26 +17,15 @@ # DEFAULT/bar: # value: barValue # -# DEPRECATED PARAMETERS -# -# [*ironic_api_paste_ini*] -# (optional) Allow configuration of /etc/ironic/api-paste.ini options. -# # NOTE: The configuration MUST NOT be already handled by this module # or Puppet catalog compilation will fail with duplicate resources. # class ironic::config ( - $ironic_config = {}, - # DEPRECATED PARAMETERS - $ironic_api_paste_ini = undef, + $ironic_config = {}, ) { include ironic::deps - if $ironic_api_paste_ini != undef { - warning('The ironic_api_paste_ini parameter is deprecated and has no effect') - } - validate_legacy(Hash, 'validate_hash', $ironic_config) create_resources('ironic_config', $ironic_config) diff --git a/manifests/deps.pp b/manifests/deps.pp index 4c421828..c8c13abb 100644 --- a/manifests/deps.pp +++ b/manifests/deps.pp @@ -26,11 +26,6 @@ class ironic::deps { ~> Service<| tag == 'ironic-service' |> ~> anchor { 'ironic::service::end': } - # paste-api.ini config should occur in the config block also. - Anchor['ironic::config::begin'] - -> Ironic_api_paste_ini<||> - ~> Anchor['ironic::config::end'] - # all db settings should be applied and all packages should be installed # before dbsync starts Oslo::Db<||> -> Anchor['ironic::dbsync::begin'] diff --git a/releasenotes/notes/remove-ironic_api_paste_ini-02c4210f79f25d82.yaml b/releasenotes/notes/remove-ironic_api_paste_ini-02c4210f79f25d82.yaml new file mode 100644 index 00000000..ac5f29f2 --- /dev/null +++ b/releasenotes/notes/remove-ironic_api_paste_ini-02c4210f79f25d82.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The ``ironic_api_paste_ini`` resource type has been deleted. + + - | + The ``ironic::config::ironic_api_paste_ini`` parameter has bee removed. diff --git a/spec/unit/provider/ironic_api_paste_ini/ini_setting_spec.rb b/spec/unit/provider/ironic_api_paste_ini/ini_setting_spec.rb deleted file mode 100644 index 977a79ff..00000000 --- a/spec/unit/provider/ironic_api_paste_ini/ini_setting_spec.rb +++ /dev/null @@ -1,29 +0,0 @@ -# -# these tests are a little concerning b/c they are hacking around the -# modulepath, so these tests will not catch issues that may eventually arise -# related to loading these plugins. -# I could not, for the life of me, figure out how to programatcally set the modulepath -$LOAD_PATH.push( - File.join( - File.dirname(__FILE__), - '..', - '..', - '..', - 'fixtures', - 'modules', - 'inifile', - 'lib') -) -require 'spec_helper' -provider_class = Puppet::Type.type(:ironic_api_paste_ini).provider(:ini_setting) -describe provider_class do - - it 'should allow setting to be set explicitly' do - resource = Puppet::Type::Ironic_api_paste_ini.new( - {:name => 'dude/foo', :value => 'bar'} - ) - provider = provider_class.new(resource) - expect(provider.section).to eq('dude') - expect(provider.setting).to eq('foo') - end -end diff --git a/spec/unit/type/ironic_api_paste_ini_spec.rb b/spec/unit/type/ironic_api_paste_ini_spec.rb deleted file mode 100644 index eb04d106..00000000 --- a/spec/unit/type/ironic_api_paste_ini_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -require 'puppet' -require 'puppet/type/ironic_api_paste_ini' - -describe 'Puppet::Type.type(:ironic_api_paste_ini)' do - before :each do - @ironic_api_paste_ini = Puppet::Type.type(:ironic_api_paste_ini).new(:name => 'DEFAULT/foo', :value => 'bar') - end - - it 'should accept a valid value' do - @ironic_api_paste_ini[:value] = 'bar' - expect(@ironic_api_paste_ini[:value]).to eq('bar') - end - - it 'should autorequire the package that install the file' do - catalog = Puppet::Resource::Catalog.new - anchor = Puppet::Type.type(:anchor).new(:name => 'ironic::install::end') - catalog.add_resource anchor, @ironic_api_paste_ini - dependency = @ironic_api_paste_ini.autorequire - expect(dependency.size).to eq(1) - expect(dependency[0].target).to eq(@ironic_api_paste_ini) - expect(dependency[0].source).to eq(anchor) - end - -end