Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 370c8e2

Browse files
committed
support current stdlib
has_key function dropped: puppetlabs/puppetlabs-stdlib#1319
1 parent 9ea6c5f commit 370c8e2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

manifests/mod.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
$mod_libs = $apache::mod_libs
5555
if $lib {
5656
$_lib = $lib
57-
} elsif has_key($mod_libs, $mod) { # 2.6 compatibility hack
57+
} elsif $mod in $mod_libs {
5858
$_lib = $mod_libs[$mod]
5959
} else {
6060
$_lib = "mod_${mod}.so"
@@ -83,7 +83,7 @@
8383
$mod_packages = $apache::mod_packages
8484
if $package {
8585
$_package = $package
86-
} elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack
86+
} elsif $mod in $mod_packages {
8787
if ($apache::apache_version == '2.4' and $::operatingsystem =~ /^[Aa]mazon$/ and $::operatingsystemmajrelease != '2') {
8888
# On amazon linux we need to prefix our package name with mod24 instead of mod to support apache 2.4
8989
$_package = regsubst($mod_packages[$mod],'^(mod_)?(.*)','mod24_\2')

manifests/mod/jk.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@
301301

302302
# Ensure that we are not using variables with the typo fixed by MODULES-6225
303303
# anymore:
304-
if !empty($workers_file_content) and has_key($workers_file_content, 'worker_mantain') {
304+
if !empty($workers_file_content) and ('worker_mantain' in $workers_file_content) {
305305
fail('Please replace $workers_file_content[\'worker_mantain\'] by $workers_file_content[\'worker_maintain\']. See MODULES-6225 for details.')
306306
}
307307

manifests/mod/php.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@
5353
$mod_packages = $apache::mod_packages
5454
if $package_name {
5555
$_package_name = $package_name
56-
} elsif has_key($mod_packages, $mod) { # 2.6 compatibility hack
56+
} elsif $mod in $mod_packages {
5757
$_package_name = $mod_packages[$mod]
58-
} elsif has_key($mod_packages, 'phpXXX') { # 2.6 compatibility hack
58+
} elsif 'phpXXX' in $mod_packages {
5959
$_package_name = regsubst($mod_packages['phpXXX'], 'XXX', $php_version)
6060
} else {
6161
$_package_name = undef

0 commit comments

Comments
 (0)