diff --git a/manifests/sink.pp b/manifests/sink.pp index e9142eef..e8422263 100644 --- a/manifests/sink.pp +++ b/manifests/sink.pp @@ -32,7 +32,7 @@ # (optional) List of notification handlers to enable, configuration of # these needs to correspond to a [handler:my_driver] section below or # else in the config. -# Defaults to undef +# Defaults to $::os_service_default # class designate::sink ( $package_ensure = present, @@ -41,7 +41,7 @@ class designate::sink ( $manage_service = true, $workers = $::os_service_default, $threads = $::os_service_default, - $enabled_notification_handlers = undef, + $enabled_notification_handlers = $::os_service_default, ) inherits designate::params { include designate::deps @@ -59,14 +59,15 @@ class designate::sink ( 'service:sink/threads': value => $threads; } - if $enabled_notification_handlers { - designate_config { - 'service:sink/enabled_notification_handlers': value => join(any2array($enabled_notification_handlers),',') - } + if ! $enabled_notification_handlers { + warning('Usage of false value for enabled_notification_handlers is deprecated. \ +Use $::os_service_default instead') + $enabled_notification_handlers_real = $::os_service_default } else { - designate_config { - 'service:sink/enabled_notification_handlers': ensure => absent - } + $enabled_notification_handlers_real = $enabled_notification_handlers } + designate_config { + 'service:sink/enabled_notification_handlers': value => join(any2array($enabled_notification_handlers_real), ',') + } } diff --git a/releasenotes/notes/simplify-enabled_notification_handlers-b223e3e445ee02ec.yaml b/releasenotes/notes/simplify-enabled_notification_handlers-b223e3e445ee02ec.yaml new file mode 100644 index 00000000..8d8112b1 --- /dev/null +++ b/releasenotes/notes/simplify-enabled_notification_handlers-b223e3e445ee02ec.yaml @@ -0,0 +1,7 @@ +--- +deprecations: + - | + Support for false value for + the ``designate::sink::enabled_notification_handlers`` parameter has been + deprecated and will be removed in a future release. + Use ``$::os_service_default`` instead. diff --git a/spec/classes/designate_sink_spec.rb b/spec/classes/designate_sink_spec.rb index 94ffc1f6..7d18f039 100644 --- a/spec/classes/designate_sink_spec.rb +++ b/spec/classes/designate_sink_spec.rb @@ -29,7 +29,7 @@ describe 'designate::sink' do it 'configures designate.conf' do is_expected.to contain_designate_config('service:sink/workers').with_value('') is_expected.to contain_designate_config('service:sink/threads').with_value('') - is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_ensure('absent') + is_expected.to contain_designate_config('service:sink/enabled_notification_handlers').with_value('') end end