diff --git a/manifests/init.pp b/manifests/init.pp index 8f84eeb44..287703370 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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; diff --git a/releasenotes/notes/deprecate_notify_api_faults_parameter-f4110213f28e8596.yaml b/releasenotes/notes/deprecate_notify_api_faults_parameter-f4110213f28e8596.yaml new file mode 100644 index 000000000..d8ec6651a --- /dev/null +++ b/releasenotes/notes/deprecate_notify_api_faults_parameter-f4110213f28e8596.yaml @@ -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. diff --git a/spec/classes/nova_init_spec.rb b/spec/classes/nova_init_spec.rb index 9e6da2039..2c6529475 100644 --- a/spec/classes/nova_init_spec.rb +++ b/spec/classes/nova_init_spec.rb @@ -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'] }