Deprecate notify_api_faults for notify_on_api_faults

When Nova moved notification parameters from [DEFAULT] to
[notifications], notify_api_faults was renamed to notify_on_api_faults.
However, the Puppet code was not updated to follow this change.

This commit sets notifications/notify_on_api_faults in nova.conf,
introduces a new parameter notify_on_api_faults, and deprecates
notify_api_faults.

Change-Id: I128c716af1dc54bb13ac2c5c713f5815708a7a1a
This commit is contained in:
Pierre Riteau 2018-03-28 14:28:05 +01:00
parent e107f4291f
commit e9aa809dd3
3 changed files with 32 additions and 5 deletions

View File

@ -315,7 +315,7 @@
# (optional) Format used for OpenStack notifications
# Defaults to ::os_service_default
#
# [*notify_api_faults*]
# [*notify_on_api_faults*]
# (optional) If set, send api.fault notifications on caught
# exceptions in the API service
# Defaults to false
@ -451,6 +451,11 @@
# zmq (for zeromq)
# Defaults to $::os_service_default
#
# [*notify_api_faults*]
# (optional) If set, send api.fault notifications on caught
# exceptions in the API service
# Defaults to undef
#
class nova(
$ensure_package = 'present',
$database_connection = undef,
@ -526,7 +531,7 @@ class nova(
$notification_driver = $::os_service_default,
$notification_topics = $::os_service_default,
$notification_format = $::os_service_default,
$notify_api_faults = false,
$notify_on_api_faults = false,
$notify_on_state_change = undef,
$os_region_name = $::os_service_default,
$cinder_catalog_info = $::os_service_default,
@ -553,6 +558,7 @@ class nova(
$rabbit_userid = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$rpc_backend = $::os_service_default,
$notify_api_faults = undef,
) inherits nova::params {
include ::nova::deps
@ -579,6 +585,12 @@ nova::rpc_backend are deprecated. Please use nova::default_transport_url \
instead.")
}
if $notify_api_faults {
warning('The notify_api_faults parameter is deprecated. Please use \
nova::notify_on_api_faults instead.')
}
$notify_on_api_faults_real = pick($notify_api_faults, $notify_on_api_faults)
if $use_ssl {
if !$cert_file {
fail('The cert_file parameter is required when use_ssl is set to true')
@ -763,7 +775,7 @@ but should be one of: ssh-rsa, ssh-dsa, ssh-ecdsa.")
nova_config {
'cinder/catalog_info': value => $cinder_catalog_info;
'os_vif_linux_bridge/use_ipv6': value => $use_ipv6;
'notifications/notify_api_faults': value => $notify_api_faults;
'notifications/notify_on_api_faults': value => $notify_on_api_faults_real;
'notifications/notification_format': value => $notification_format;
# Following may need to be broken out to different nova services
'DEFAULT/state_path': value => $state_path;

View File

@ -0,0 +1,4 @@
---
deprecations:
- nova::notify_api_faults is deprecated and will be removed in a future
release. Please use nova::notify_on_api_faults instead.

View File

@ -99,7 +99,7 @@ describe 'nova' do
:notification_driver => 'ceilometer.compute.nova_notifier',
:notification_topics => 'openstack',
:notification_format => 'unversioned',
:notify_api_faults => true,
:notify_on_api_faults => true,
:report_interval => '60',
:os_region_name => 'MyRegion',
:use_ipv6 => true,
@ -182,7 +182,7 @@ describe 'nova' do
is_expected.to contain_nova_config('oslo_messaging_notifications/driver').with_value('ceilometer.compute.nova_notifier')
is_expected.to contain_nova_config('oslo_messaging_notifications/topics').with_value('openstack')
is_expected.to contain_nova_config('notifications/notification_format').with_value('unversioned')
is_expected.to contain_nova_config('notifications/notify_api_faults').with_value(true)
is_expected.to contain_nova_config('notifications/notify_on_api_faults').with_value(true)
is_expected.to contain_nova_config('DEFAULT/report_interval').with_value('60')
is_expected.to contain_nova_config('os_vif_linux_bridge/use_ipv6').with_value('true')
is_expected.to contain_nova_config('cinder/os_region_name').with_value('MyRegion')
@ -222,6 +222,17 @@ describe 'nova' do
end
end
context 'with deprecated notify_api_faults parameter' do
let :params do
{ :notify_on_api_faults => :undef,
:notify_api_faults => 'true' }
end
it 'configures notify_on_api_faults using the deprecated parameter' do
is_expected.to contain_nova_config('notifications/notify_on_api_faults').with_value('true')
end
end
context 'with rabbit_hosts parameter' do
let :params do
{ :rabbit_hosts => ['rabbit:5673', 'rabbit2:5674'] }