From 78278f50b54882183020a0a4e07e5f73804ced09 Mon Sep 17 00:00:00 2001 From: Wolf Noble Date: Wed, 24 Apr 2013 15:35:08 -0500 Subject: [PATCH] restore package_name parameter to maintain backward compatibility. Removal of the ambiguously named package_name parameter, without having a version provide a deprecation warning for a reasonable amount of time seems unreasonable. As Hunner suggests, adding a workaround variable to init.pp and use that as package name gives us the ability to warn users about the upcoming deprecation, while still maintaining backwards compatibility. --- manifests/init.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3c132bc..a33c493 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -28,6 +28,8 @@ # # [*old_root_password*] - Previous root user password, # +# [*package_name*] - legacy parameter used to specify the client package. Should not be used going forward +# # [*package_ensure*] - ensure value for packages. # # [*php_package_name*] - The name of the phpmysql package to install @@ -86,6 +88,7 @@ class mysql( $log_error = $mysql::params::log_error, $manage_service = $mysql::params::manage_service, $old_root_password = $mysql::params::old_root_password, + $package_name = undef, $package_ensure = $mysql::params::package_ensure, $php_package_name = $mysql::params::php_package_name, $pidfile = $mysql::params::pidfile, @@ -105,10 +108,15 @@ class mysql( $ssl_cert = $mysql::params::ssl_cert, $ssl_key = $mysql::params::ssl_key, ) inherits mysql::params{ - + if $package_name { + warning('Using $package_name has been deprecated in favor of $client_package_name and will be removed.') + $client_package_name_real = $package_name + } else { + $client_package_name_real = $client_package_name + } package { 'mysql_client': ensure => $package_ensure, - name => $client_package_name, + name => $client_package_name_real, } }