Skip to content

Commit

Permalink
Don't use Mixlib::ShellOut in the redisio cookbook.
Browse files Browse the repository at this point in the history
I have nothing against Mixlib::ShellOut; however, it doesn't exist in
the version of Chef we're using.
  • Loading branch information
David Yip committed May 29, 2013
1 parent 5f3c979 commit 4ec2c67
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions chef/cookbooks/redisio/providers/install.rb
Expand Up @@ -259,16 +259,19 @@ def configure
end

def redis_exists?
exists = Mixlib::ShellOut.new("which redis-server")
exists.run_command
exists.exitstatus == 0 ? true : false
`which redis-server`
$?.success?
end

def version
if redis_exists?
redis_version = Mixlib::ShellOut.new("redis-server -v")
redis_version.run_command
version = redis_version.stdout[/version (\d*.\d*.\d*)/,1] || redis_version.stdout[/v=(\d*.\d*.\d*)/,1]
output = `redis-server -v`
unless output =~ /version (\d*.\d*.\d*)/
output =~ /v=(\d*.\d*.\d*)/
end

version = $1

Chef::Log.info("The Redis server version is: #{version}")
return version.gsub("\n",'')
end
Expand Down

0 comments on commit 4ec2c67

Please sign in to comment.