From 199e84fad92e4a2b8b11c02a82acc120ecab95cf Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 8 Nov 2023 10:14:37 +0900 Subject: [PATCH] Support [oslo_messaging_notifications] retry option Change-Id: I2c948ae091ab6533022703afb7b5a05a278abcc0 --- manifests/messaging/notifications.pp | 7 +++++++ .../messaging-notification-retry-4080762ebe815271.yaml | 4 ++++ spec/defines/oslo_messaging_notifications_spec.rb | 3 +++ 3 files changed, 14 insertions(+) create mode 100644 releasenotes/notes/messaging-notification-retry-4080762ebe815271.yaml diff --git a/manifests/messaging/notifications.pp b/manifests/messaging/notifications.pp index 7b3c2dd..3dcfe0c 100644 --- a/manifests/messaging/notifications.pp +++ b/manifests/messaging/notifications.pp @@ -27,10 +27,16 @@ # (list value) # Defaults to $facts['os_service_default']. # +# [*retry*] +# (Optional) The maximum number of attempts to re-sent a notification +# message, which failed to be delivered due to a recoverable error. +# Defaults to $facts['os_service_default']. +# define oslo::messaging::notifications( $driver = $facts['os_service_default'], $transport_url = $facts['os_service_default'], $topics = $facts['os_service_default'], + $retry = $facts['os_service_default'], ) { if $transport_url =~ 'amqp://.+' { @@ -50,6 +56,7 @@ define oslo::messaging::notifications( 'oslo_messaging_notifications/driver' => { value => $driver_real }, 'oslo_messaging_notifications/transport_url' => { value => $transport_url, secret => true }, 'oslo_messaging_notifications/topics' => { value => $topics_real }, + 'oslo_messaging_notifications/retry' => { value => $retry }, } create_resources($name, $notification_options) diff --git a/releasenotes/notes/messaging-notification-retry-4080762ebe815271.yaml b/releasenotes/notes/messaging-notification-retry-4080762ebe815271.yaml new file mode 100644 index 0000000..127950c --- /dev/null +++ b/releasenotes/notes/messaging-notification-retry-4080762ebe815271.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + The new ``oslo::messaging::notification::retry`` parameter has been added. diff --git a/spec/defines/oslo_messaging_notifications_spec.rb b/spec/defines/oslo_messaging_notifications_spec.rb index 8728bc3..85aa3f3 100644 --- a/spec/defines/oslo_messaging_notifications_spec.rb +++ b/spec/defines/oslo_messaging_notifications_spec.rb @@ -11,6 +11,7 @@ describe 'oslo::messaging::notifications' do is_expected.to contain_keystone_config('oslo_messaging_notifications/driver').with_value('') is_expected.to contain_keystone_config('oslo_messaging_notifications/transport_url').with_value('').with_secret(true) is_expected.to contain_keystone_config('oslo_messaging_notifications/topics').with_value('') + is_expected.to contain_keystone_config('oslo_messaging_notifications/retry').with_value('') end end @@ -20,6 +21,7 @@ describe 'oslo::messaging::notifications' do { :driver => ['messaging', 'messagingv2'], :transport_url => 'some_protocol://some_url', :topics => ['foo', 'baa'], + :retry => -1, } end @@ -27,6 +29,7 @@ describe 'oslo::messaging::notifications' do is_expected.to contain_keystone_config('oslo_messaging_notifications/driver').with_value(['messaging', 'messagingv2']) is_expected.to contain_keystone_config('oslo_messaging_notifications/transport_url').with_value('some_protocol://some_url').with_secret(true) is_expected.to contain_keystone_config('oslo_messaging_notifications/topics').with_value('foo,baa') + is_expected.to contain_keystone_config('oslo_messaging_notifications/retry').with_value(-1) end end