Skip to content

Commit

Permalink
Merge pull request #345 from superseb/fix_redis_reconnect_on_error
Browse files Browse the repository at this point in the history
Boolean checking/converting on sensu_redis_config
  • Loading branch information
jlambert121 committed Apr 15, 2015
2 parents 72777ba + 05999a6 commit 4ab4182
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions lib/puppet/provider/sensu_redis_config/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,22 @@ def password=(value)
end

def reconnect_on_error
conf['redis']['reconnect_on_error']
case conf['redis']['reconnect_on_error']
when true
:true
when false
:false
else
conf['redis']['reconnect_on_error']
end
end

def reconnect_on_error=(value)
conf['redis']['reconnect_on_error'] = (value ? true : false)
case value
when true, 'true', 'True', :true, 1
conf['redis']['reconnect_on_error'] = true
else
conf['redis']['reconnect_on_error'] = false
end
end
end
4 changes: 2 additions & 2 deletions lib/puppet/type/sensu_redis_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def initialize(*args)
newproperty(:reconnect_on_error, :boolean => true) do
desc "Attempt to reconnect to RabbitMQ on error"

newvalues(true, false)
defaultto false
newvalues(:true, :false)
defaultto :false
end

autorequire(:package) do
Expand Down

0 comments on commit 4ab4182

Please sign in to comment.