Inconsistent package_ensure parameter name

The parameter name used to enforce package state is inconsistent across
manifests and modules. I settle on package_ensure since it's already
widely used.

Change-Id: I4392919b99e51a11896ea88d7de431d01b99f8f3
Closes-Bug: #1668732
This commit is contained in:
ZhongShengping 2017-03-08 16:24:16 +08:00
parent ce5c607c7f
commit 75d16a7a31
3 changed files with 21 additions and 4 deletions

View File

@ -4,7 +4,7 @@
#
# === Parameters
#
# [*ensure_package*]
# [*package_ensure*]
# (optional) The state of aodh packages
# Defaults to 'present'
#
@ -260,8 +260,12 @@
# (optional) The RabbitMQ virtual host.
# Defaults to $::os_service_default
#
# [*ensure_package*]
# (optional) The state of aodh packages
# Defaults to undef
#
class aodh (
$ensure_package = 'present',
$package_ensure = 'present',
$alarm_history_time_to_live = $::os_service_default,
$default_transport_url = $::os_service_default,
$rpc_response_timeout = $::os_service_default,
@ -319,6 +323,7 @@ class aodh (
$rabbit_port = $::os_service_default,
$rabbit_userid = $::os_service_default,
$rabbit_virtual_host = $::os_service_default,
$ensure_package = undef,
) inherits aodh::params {
include ::aodh::deps
@ -336,8 +341,16 @@ aodh::rabbit_port, aodh::rabbit_userid and aodh::rabbit_virtual_host are \
deprecated. Please use aodh::default_transport_url instead.")
}
if $ensure_package {
warning("aodh::ensure_package is deprecated and will be removed in \
the future release. Please use aodh::package_ensure instead.")
$package_ensure_real = $ensure_package
} else {
$package_ensure_real = $package_ensure
}
package { 'aodh':
ensure => $ensure_package,
ensure => $package_ensure_real,
name => $::aodh::params::common_package_name,
tag => ['openstack', 'aodh-package'],
}

View File

@ -0,0 +1,4 @@
---
deprecations:
- aodh::ensure_package is now deprecated and will be removed in the
future release. Please use aodh::package_ensure instead.

View File

@ -64,7 +64,7 @@ describe 'aodh' do
:rabbit_heartbeat_timeout_threshold => '60',
:rabbit_heartbeat_rate => '10',
:kombu_compression => 'gzip',
:ensure_package => '2012.1.1-15.el6',
:package_ensure => '2012.1.1-15.el6',
:gnocchi_url => 'http://127.0.0.1:8041',
:notification_transport_url => 'rabbit://rabbit_user:password@localhost:5673',
:notification_driver => 'ceilometer.compute.aodh_notifier',