Remove deprecated neutron_api_config
The neutron_api_config type was deprecated during Victoria cycle in
favor of the neutron_api_ini type which provides the same feature[1].
Because some cycles have passed since that deprecation, we are now
ready to remove it.
[1] 2daa0b1644
Change-Id: I8bdc79a599b740a12dc40f8733d210c2929f550c
This commit is contained in:
@@ -1,15 +0,0 @@
|
|||||||
Puppet::Type.type(:neutron_api_config).provide(
|
|
||||||
:ini_setting,
|
|
||||||
:parent => Puppet::Type.type(:openstack_config).provider(:ini_setting)
|
|
||||||
) do
|
|
||||||
|
|
||||||
def self.file_path
|
|
||||||
'/etc/neutron/api-paste.ini'
|
|
||||||
end
|
|
||||||
|
|
||||||
# added for backwards compatibility with older versions of inifile
|
|
||||||
def file_path
|
|
||||||
self.class.file_path
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -1,48 +0,0 @@
|
|||||||
Puppet::Type.newtype(:neutron_api_config) do
|
|
||||||
|
|
||||||
ensurable
|
|
||||||
|
|
||||||
newparam(:name, :namevar => true) do
|
|
||||||
desc 'Section/setting name to manage from 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('<SERVICE DEFAULT>')
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
@@ -36,7 +36,6 @@ class neutron::deps {
|
|||||||
Anchor['neutron::config::begin'] -> Neutron_agent_linuxbridge<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_linuxbridge<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_agent_ovs<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_ovs<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_agent_vpp<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_agent_vpp<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_api_config<||> ~> Anchor['neutron::config::end']
|
|
||||||
Anchor['neutron::config::begin'] -> Neutron_api_paste_ini<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_api_paste_ini<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_bagpipe_config<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_bagpipe_config<||> ~> Anchor['neutron::config::end']
|
||||||
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_service_config<||> ~> Anchor['neutron::config::end']
|
Anchor['neutron::config::begin'] -> Neutron_bgpvpn_service_config<||> ~> Anchor['neutron::config::end']
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
upgrade:
|
||||||
|
- |
|
||||||
|
The ``neutron_api_config`` type has been removed.
|
@@ -1,51 +0,0 @@
|
|||||||
require 'spec_helper'
|
|
||||||
|
|
||||||
provider_class = Puppet::Type.type(:neutron_api_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::Neutron_api_config.new(
|
|
||||||
{
|
|
||||||
:name => 'DEFAULT/foo',
|
|
||||||
:value => 'bar'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
expect(provider.section).to eq('DEFAULT')
|
|
||||||
expect(provider.setting).to eq('foo')
|
|
||||||
expect(provider.file_path).to eq('/etc/neutron/api-paste.ini')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should allow setting to be set explicitly' do
|
|
||||||
resource = Puppet::Type::Neutron_api_config.new(
|
|
||||||
{
|
|
||||||
:name => 'dude/foo',
|
|
||||||
:value => 'bar'
|
|
||||||
}
|
|
||||||
)
|
|
||||||
provider = provider_class.new(resource)
|
|
||||||
expect(provider.section).to eq('dude')
|
|
||||||
expect(provider.setting).to eq('foo')
|
|
||||||
expect(provider.file_path).to eq('/etc/neutron/api-paste.ini')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
|
|
||||||
resource = Puppet::Type::Neutron_api_config.new(
|
|
||||||
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
|
|
||||||
)
|
|
||||||
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::Neutron_api_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
|
|
Reference in New Issue
Block a user