From 04579f3c13bf499cefab36abcd79a6da148da12e Mon Sep 17 00:00:00 2001 From: Steve Mokris Date: Thu, 14 Mar 2024 20:49:28 -0400 Subject: [PATCH] Fix behavior of php::packages::names_to_prefix The documentation for php::packages::names_to_prefix suggests that the module will add php::package_prefix to the beginning of the listed package names. However, since the prefix() function is in the parameter default, the prefix is only applied to the default value (php::params::common_package_suffixes) rather than to user-defined php::packages::names_to_prefix. This commit fixes that behavior, so that either the default or user-defined php::packages::names_to_prefix will have prefixes added by the module. --- manifests/packages.pp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/packages.pp b/manifests/packages.pp index 2cc0f2ec..317b6104 100644 --- a/manifests/packages.pp +++ b/manifests/packages.pp @@ -15,12 +15,13 @@ class php::packages ( String $ensure = $php::ensure, Boolean $manage_repos = $php::manage_repos, - Array $names_to_prefix = prefix($php::params::common_package_suffixes, $php::package_prefix), + Array $names_to_prefix = $php::params::common_package_suffixes, Array $names = $php::params::common_package_names, ) inherits php::params { assert_private() - $real_names = union($names, $names_to_prefix) + $names_with_prefix = prefix($names_to_prefix, $php::package_prefix) + $real_names = union($names, $names_with_prefix) if $facts['os']['family'] == 'Debian' { if $manage_repos { include apt