Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions lib/facter/tuned.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
false => absent
}

ensure_packages($tuned::packages, {
stdlib::ensure_packages($tuned::packages, {
ensure => $_ensure,
})
}
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$sleep_interval = 1
$update_interval = 10

if has_key($facts, 'tuned_version') and $facts['tuned_version'] =~ /^(\d+)\.[\d\.]+$/ {
if 'tuned_version' in $facts and $facts['tuned_version'] =~ /^(\d+)\.[\d\.]+$/ {
$_majversion = $1
} else {
$_majversion = undef
Expand Down