Skip to content

Commit

Permalink
singular check in a file
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Feb 26, 2013
1 parent dfcec1e commit 9c48b1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/sensu_check_config/json.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ def initialize(*args)

def conf
begin
@conf ||= JSON.parse(File.read("/etc/sensu/conf.d/checks_#{resource[:realname]}.json"))
@conf ||= JSON.parse(File.read("/etc/sensu/conf.d/check_#{resource[:realname]}.json"))
rescue
@conf ||= {}
end
end

def flush
File.open("/etc/sensu/conf.d/checks_#{resource[:realname]}.json", 'w') do |f|
File.open("/etc/sensu/conf.d/check_#{resource[:realname]}.json", 'w') do |f|
f.puts JSON.pretty_generate(conf)
end
end
Expand Down

0 comments on commit 9c48b1d

Please sign in to comment.