Remove deprecated notification parameters

Remove deprecated sahara::notify::enable_notifications parameter.
Remove deprecated sahara::notify::control_exchange parameter.
Remove deprecated sahara::notify::notification_level parameter.

Change-Id: I3fa25372ff427ee669d766c1ed456057ab031bb6
Depends-On: I2d3dff9ae45b8e409c5deecc9dfb70b3555a99e4
This commit is contained in:
ZhongShengping 2017-03-10 08:55:46 +08:00
parent 11c245544c
commit 7636b482b7
4 changed files with 7 additions and 41 deletions

View File

@ -12,7 +12,7 @@
#
# [*notification_driver*]
# (Optional) Notification driver to use. WARNING: the enable_notifications is
# deprecated. plese specify the notification_driver if you wish to enable
# deprecated. plese specify the notification_driver if you wish to enable
# notifications
# Defaults to $::os_service_default.
#
@ -20,53 +20,18 @@
# (Optional) Topic to use for notifications.
# Defaults to $::os_service_default.
#
# == DEPRECATED PARAMETERS
#
# [*control_exchange*]
# (Optional) Moved to init.pp. The default exchange to scope topics.
# Defaults to undef.
#
# [*enable_notifications*]
# (Optional) Enables sending notifications to Ceilometer.
# Defaults to undef.
#
# [*notification_level*]
# (Optional) Notification level for outgoing notifications.
# Defaults to undef.
#
class sahara::notify (
$notification_transport_url = $::os_service_default,
$notification_driver = $::os_service_default,
$notification_topics = $::os_service_default,
# DEPRECATED PARAMETERS
$control_exchange = undef,
$enable_notifications = undef,
$notification_level = undef,
) {
include ::sahara::deps
if $control_exchange {
warning('control_exchange is moved to ::sahara and will be removed from sahara::notify in a future release')
}
if $enable_notifications {
warning("The enable_notifications is deprecated and will be removed in a future release. plese specify \
the notification_driver if you wish to enable notifications")
}
if $notification_level {
warning('notification_level is deprecated and will be removed in a future release')
}
oslo::messaging::notifications { 'sahara_config':
transport_url => $notification_transport_url,
driver => $notification_driver,
topics => $notification_topics,
}
# TODO(xingzhou): these are deprecated, remove in P
sahara_config {
'oslo_messaging_notifications/enable': ensure => 'absent';
'oslo_messaging_notifications/level': ensure => 'absent';
}
}

View File

@ -0,0 +1,5 @@
---
other:
- Remove deprecated sahara::notify::enable_notifications parameter.
- Remove deprecated sahara::notify::control_exchange parameter.
- Remove deprecated sahara::notify::notification_level parameter.

View File

@ -45,9 +45,7 @@ describe 'basic sahara' do
password => 'a_big_secret',
}
class { '::sahara::client': }
class { '::sahara::notify':
enable_notifications => true,
}
class { '::sahara::notify': }
EOS

View File

@ -4,10 +4,8 @@ describe 'sahara::notify' do
shared_examples_for 'sahara-notify' do
context 'when defaults parameters' do
it { is_expected.to contain_sahara_config('oslo_messaging_notifications/transport_url').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('oslo_messaging_notifications/enable').with_ensure('absent')}
it { is_expected.to contain_sahara_config('oslo_messaging_notifications/driver').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('oslo_messaging_notifications/topics').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_sahara_config('oslo_messaging_notifications/level').with_ensure('absent') }
end
context 'with overridden parameters' do