Skip to content

Commit

Permalink
Merge pull request voxpupuli#129 from bastelfreak/has_key
Browse files Browse the repository at this point in the history
replace deprecated has_key() with `in`
  • Loading branch information
bastelfreak committed Dec 31, 2018
2 parents ce42920 + ce30dd8 commit 01fc44f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,6 @@ matrix:
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6-nightly BEAKER_debug=true BEAKER_setfile=centos6-64 BEAKER_HYPERVISOR=docker CHECK=beaker
services: docker
sudo: required
- rvm: 2.5.1
bundler_args: --without development release
dist: trusty
Expand Down
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@
$yumrepo: * => $attributes,
}
# Handle GPG Key
if has_key($attributes, 'gpgkey') {
if ('gpgkey' in $attributes) {
$matches = $attributes['gpgkey'].match('^file://(.*)$')
if $matches {
$gpgkey = $matches[1]
if $gpgkey =~ Stdlib::AbsolutePath and has_key($gpgkeys, $gpgkey) {
if $gpgkey =~ Stdlib::AbsolutePath and $gpgkey in $gpgkeys {
if !defined(Yum::Gpgkey[$gpgkey]) {
yum::gpgkey { $gpgkey:
* => $gpgkeys[$gpgkey],
Expand All @@ -155,7 +155,7 @@
}

unless empty($config_options) {
if has_key($config_options, 'installonly_limit') {
if ('installonly_limit' in $config_options) {
assert_type(Variant[Integer, Hash[String, Integer]], $config_options['installonly_limit']) |$expected, $actual| {
fail("The value or ensure for `\$yum::config_options[installonly_limit]` must be an Integer, but it is not.")
}
Expand Down

0 comments on commit 01fc44f

Please sign in to comment.