Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CentOS/RHEL fact #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
10 changes: 5 additions & 5 deletions lib/facter/redis_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@

setcode do

yum = `which yum 2> /dev/null`.chomp
if yum == ''
yum = '/usr/bin/yum'
rpm = `which rpm 2> /dev/null`.chomp
if rpm == ''
rpm = '/usr/bin/rpm'
end

redis_version = Facter::Util::Resolution.exec('/usr/sbin/redis-server --version')
if redis_version.nil?
redis_version = Facter::Util::Resolution.exec(yum+" info redis 2> /dev/null | /bin/grep '^Version' | /bin/awk -F ':' '{printf(\"%s\",$2)}' | sort -nr | head -1")
redis_version = Facter::Util::Resolution.exec(rpm+" -q --queryformat '%{version}\\n' redis | grep -v 'not installed' | sort -nr | head -1")
end

case redis_version
Expand All @@ -64,7 +64,7 @@
#set version to 2.2
redis_version = '2.2.x'
else
redis_version = 'nil'
redis_version = nil
end
redis_version
end
Expand Down