Browse Source

Merge "Accept string for enabled_notification_handlers"

changes/30/823030/2
Zuul 8 months ago committed by Gerrit Code Review
parent
commit
25d74711b2
  1. 4
      manifests/sink.pp
  2. 25
      spec/classes/designate_sink_spec.rb

4
manifests/sink.pp

@ -46,11 +46,11 @@ class designate::sink (
if $enabled_notification_handlers {
designate_config {
'service:sink/enabled_notification_handlers': value => join($enabled_notification_handlers,',')
'service:sink/enabled_notification_handlers': value => join(any2array($enabled_notification_handlers),',')
}
} else {
designate_config {
'service:sink/enabled_notification_handlers': ensure => absent
'service:sink/enabled_notification_handlers': ensure => absent
}
}

25
spec/classes/designate_sink_spec.rb

@ -26,12 +26,27 @@ describe 'designate::sink' do
)
is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_ensure('absent')
end
end
context 'when using enabled_notification_handlers' do
before { params.merge!(:enabled_notification_handlers => ['nova_fixed','neutron_floatingip']) }
it 'configures designate-sink with enabled_notification_handlers' do
is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_value(['nova_fixed,neutron_floatingip'])
end
context 'with enabled_notification_handlers (array)' do
before do
params.merge!(
:enabled_notification_handlers => ['nova_fixed', 'neutron_floatingip']
)
end
it 'configures designate-sink with enabled_notification_handlers' do
is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_value('nova_fixed,neutron_floatingip')
end
end
context 'with enabled_notification_handlers (string)' do
before do
params.merge!(
:enabled_notification_handlers => 'nova_fixed,neutron_floatingip'
)
end
it 'configures designate-sink with enabled_notification_handlers' do
is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_value('nova_fixed,neutron_floatingip')
end
end

Loading…
Cancel
Save