From 8c8e529bc402331c8b14ae87fe3b43dcd5f4351c Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Wed, 26 Apr 2023 20:20:19 +0200 Subject: [PATCH] Remove has_key usage In the next puppetlabs-stdlib major version this function will be dropped. Native Puppet is used instead. https://github.com/puppetlabs/puppetlabs-stdlib/pull/1319 broke this --- manifests/mod.pp | 4 ++-- manifests/mod/jk.pp | 2 +- manifests/mod/php.pp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/mod.pp b/manifests/mod.pp index 92fbc9528e..9c9b26c39c 100644 --- a/manifests/mod.pp +++ b/manifests/mod.pp @@ -54,7 +54,7 @@ $mod_libs = $apache::mod_libs if $lib { $_lib = $lib - } elsif has_key($mod_libs, $mod) { # 2.6 compatibility hack + } elsif $mod in $mod_libs { # 2.6 compatibility hack $_lib = $mod_libs[$mod] } else { $_lib = "mod_${mod}.so" @@ -83,7 +83,7 @@ $mod_packages = $apache::mod_packages if $package { $_package = $package - } elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack + } elsif $mod in $mod_packages { # 2.6 compatibility hack $_package = $mod_packages[$mod] } else { $_package = undef diff --git a/manifests/mod/jk.pp b/manifests/mod/jk.pp index a169b366f5..b288fe64c0 100644 --- a/manifests/mod/jk.pp +++ b/manifests/mod/jk.pp @@ -329,7 +329,7 @@ # Ensure that we are not using variables with the typo fixed by MODULES-6225 # anymore: - if !empty($workers_file_content) and has_key($workers_file_content, 'worker_mantain') { + if !empty($workers_file_content) and 'worker_mantain' in $workers_file_content { fail('Please replace $workers_file_content[\'worker_mantain\'] by $workers_file_content[\'worker_maintain\']. See MODULES-6225 for details.') } diff --git a/manifests/mod/php.pp b/manifests/mod/php.pp index 1f5f241eb0..940e7b30d1 100644 --- a/manifests/mod/php.pp +++ b/manifests/mod/php.pp @@ -81,9 +81,9 @@ $mod_packages = $apache::mod_packages if $package_name { $_package_name = $package_name - } elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack + } elsif $mod in $mod_packages { # 2.6 compatibility hack $_package_name = $mod_packages[$mod] - } elsif has_key($mod_packages, 'phpXXX') { # 2.6 compatibility hack + } elsif 'phpXXX' in $mod_packages { # 2.6 compatibility hack $_package_name = regsubst($mod_packages['phpXXX'], 'XXX', $php_version) } else { $_package_name = undef