Support [oslo_messaging_notifications] retry option

Change-Id: I2c948ae091ab6533022703afb7b5a05a278abcc0
This commit is contained in:
Takashi Kajinami 2023-11-08 10:14:37 +09:00
parent 7fa3b0ee0d
commit 199e84fad9
3 changed files with 14 additions and 0 deletions

View File

@ -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)

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``oslo::messaging::notification::retry`` parameter has been added.

View File

@ -11,6 +11,7 @@ describe 'oslo::messaging::notifications' do
is_expected.to contain_keystone_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>').with_secret(true)
is_expected.to contain_keystone_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>')
is_expected.to contain_keystone_config('oslo_messaging_notifications/retry').with_value('<SERVICE DEFAULT>')
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