Skip to content

Commit

Permalink
Merge pull request #74 from jlambert121/safe_mode_fix
Browse files Browse the repository at this point in the history
ensure safe_mode param is a boolean
  • Loading branch information
jamtur01 committed May 9, 2013
2 parents ef00e2e + 5064b87 commit cae4262
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions lib/puppet/provider/sensu_client_config/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,24 @@ def subscriptions=(value)
end

def safe_mode
@conf['client']['safe_mode']
case @conf['client']['safe_mode']
when true
:true
when false
:false
else
@conf['client']['safe_mode']
end
end

def safe_mode=(value)
@conf['client']['safe_mode'] = value
case value
when true, 'true', 'True', :true, 1
@conf['client']['safe_mode'] = true
else
@conf['client']['safe_mode'] = false
end
end

end

0 comments on commit cae4262

Please sign in to comment.