Add ensure_absent_val behavior to Nuage neutron plugin type
This change adds ensure_absent_val behavior to Nuage neutron plugin type. This property ensure absent when the value is either specified as <SERVICE DEFAULT> or ensure_absent_val. Added spec tests for ensure_absent_val Change-Id: Ifb9df534463a820ac5b2c3b965e01bc61833f8de
This commit is contained in:
parent
7baa3858af
commit
1aabf09322
|
@ -16,6 +16,11 @@ Puppet::Type.newtype(:neutron_plugin_nuage) do
|
|||
end
|
||||
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
|
||||
|
||||
autorequire(:package) do
|
||||
'neutron-plugin-nuage'
|
||||
end
|
||||
|
|
|
@ -33,5 +33,23 @@ describe provider_class do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
|
||||
resource = Puppet::Type::Neutron_plugin_nuage.new(
|
||||
{:name => 'somename/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_plugin_nuage.new(
|
||||
{:name => 'somename/foo', :value => 'foo', :ensure_absent_val => 'foo' }
|
||||
)
|
||||
provider = provider_class.new(resource)
|
||||
provider.exists?
|
||||
expect(resource[:ensure]).to eq :absent
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue