From 48cc304157e5999b0bf88779bb962e9905afbee7 Mon Sep 17 00:00:00 2001 From: Linas Daneliukas Date: Thu, 22 Jun 2023 15:58:34 +0300 Subject: [PATCH 1/5] Use Stdlib::Absolutepath instead of Stdlib::Compat::Absolutepath Using stdlib >=9.0.0 will fail due to a resource not found error for Stdlib::Compat::Absolutepath --- manifests/init.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/init.pp b/manifests/init.pp index f18a2b2..6e587d9 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -5,7 +5,7 @@ Integer $sleep_interval = $tuned::params::sleep_interval, Integer $update_interval = $tuned::params::update_interval, String $majversion = $tuned::params::majversion, - Variant[Stdlib::Compat::Absolute_path, String[0,0]] $main_conf = $tuned::params::main_conf, + Variant[Stdlib::Absolutepath, String[0,0]] $main_conf = $tuned::params::main_conf, Stdlib::Absolutepath $profiles_path = $tuned::params::profiles_path, String $active_profile_conf = $tuned::params::active_profile_conf, Array[String, 1] $packages = $tuned::params::packages, From 0c7964fa4fc4651a96abdf8b761328619acebf6c Mon Sep 17 00:00:00 2001 From: Linas Daneliukas Date: Thu, 22 Jun 2023 16:02:01 +0300 Subject: [PATCH 2/5] has_key was deprecated since Puppet 4.0.0 https://github.com/puppetlabs/puppetlabs-stdlib/pull/1319 --- manifests/params.pp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index bb6d6bf..bba3172 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,7 +4,11 @@ $sleep_interval = 1 $update_interval = 10 - if has_key($facts, 'tuned_version') and $facts['tuned_version'] =~ /^(\d+)\.[\d\.]+$/ { + $my_hash = {'key_one' => 'value_one'} + if 'key_one' in $my_hash { + notice('this will be printed') + } + if 'tuned_version' in $facts and $facts['tuned_version'] =~ /^(\d+)\.[\d\.]+$/ { $_majversion = $1 } else { $_majversion = undef From a361f4b9d2d4914259ca50ed72217a8212d143f7 Mon Sep 17 00:00:00 2001 From: Linas Daneliukas Date: Thu, 22 Jun 2023 16:03:17 +0300 Subject: [PATCH 3/5] Update params.pp --- manifests/params.pp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index bba3172..c7607f2 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -4,10 +4,6 @@ $sleep_interval = 1 $update_interval = 10 - $my_hash = {'key_one' => 'value_one'} - if 'key_one' in $my_hash { - notice('this will be printed') - } if 'tuned_version' in $facts and $facts['tuned_version'] =~ /^(\d+)\.[\d\.]+$/ { $_majversion = $1 } else { From b9903952d5084686dffc714088f0b76b933cfa88 Mon Sep 17 00:00:00 2001 From: Linas Daneliukas Date: Wed, 12 Jul 2023 10:22:33 +0300 Subject: [PATCH 4/5] Update install.pp ensure_packages: DEPRECATED. Use the namespaced function stdlib::ensure_packages instead. --- manifests/install.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/install.pp b/manifests/install.pp index 392871b..b51eab6 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,7 +4,7 @@ false => absent } - ensure_packages($tuned::packages, { + stdlib::ensure_packages($tuned::packages, { ensure => $_ensure, }) } From e2f874bc1df9e7a2c85bd863d38637e318377e2c Mon Sep 17 00:00:00 2001 From: Linas Daneliukas Date: Fri, 30 May 2025 11:00:17 +0300 Subject: [PATCH 5/5] Update tuned.rb --- lib/facter/tuned.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/facter/tuned.rb b/lib/facter/tuned.rb index 7685f76..e1a084a 100644 --- a/lib/facter/tuned.rb +++ b/lib/facter/tuned.rb @@ -10,8 +10,11 @@ out = Facter::Core::Execution.exec('tuned --version 2>&1') if out && out =~ %r{^tuned ([\d\.]+)$}i Regexp.last_match(1) - elsif !Facter::Core::Execution.exec('which tuned 2>/dev/null').empty? - 'unknown' + else + out = Facter::Core::Execution.exec('which tuned 2>/dev/null') + if ! out || out.empty? + 'unknown' + end end end end @@ -33,7 +36,7 @@ ] alternatives.each do |fn| - if FileTest.exists?(fn) && !File.empty?(fn) + if File.exist?(fn) && !File.empty?(fn) result = File.foreach(fn).first.chomp break end