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
(cherry picked from commit e9aa809dd3)
This commit is contained in:
Pierre Riteau 2018-03-28 14:28:05 +01:00 committed by Rajesh Tailor
parent 5d25320367
commit 5a5736316e
3 changed files with 31 additions and 5 deletions

View File

@ -323,7 +323,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
@ -461,6 +461,10 @@
#
# [*image_service*]
# (optional) Service used to search for and retrieve images.
#
# [*notify_api_faults*]
# (optional) If set, send api.fault notifications on caught
# exceptions in the API service
# Defaults to undef
#
class nova(
@ -540,7 +544,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,
@ -568,6 +572,7 @@ class nova(
$rabbit_virtual_host = $::os_service_default,
$rpc_backend = $::os_service_default,
$image_service = undef,
$notify_api_faults = undef,
) inherits nova::params {
include ::nova::deps
@ -599,6 +604,12 @@ instead.")
already using python-glanceclient instead of old glance client.')
}
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')
@ -783,7 +794,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

@ -100,7 +100,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,
@ -185,7 +185,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')
@ -228,6 +228,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'] }