Skip to content

Commit

Permalink
output boolean type for standalone and aggregate
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Mar 11, 2013
1 parent 8b244f6 commit b098996
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions lib/puppet/provider/sensu_check/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ def aggregate
end

def aggregate=(value)
conf['checks'][resource[:realname]]['aggregate'] = value
case value
when true, 'true', 'True', :true, 1
conf['checks'][resource[:realname]]['aggregate'] = true
when false, 'false', 'False', :false, 0
conf['checks'][resource[:realname]]['aggregate'] = false
else
conf['checks'][resource[:realname]]['aggregate'] = value
end
end

def command
Expand Down Expand Up @@ -143,6 +150,15 @@ def standalone
end

def standalone=(value)
conf['checks'][resource[:realname]]['standalone'] = value
puts value
puts value.class
case value
when true, 'true', 'True', :true, 1
conf['checks'][resource[:realname]]['standalone'] = true
when false, 'false', 'False', :false, 0
conf['checks'][resource[:realname]]['standalone'] = false
else
conf['checks'][resource[:realname]]['standalone'] = value
end
end
end

0 comments on commit b098996

Please sign in to comment.