Skip to content

Commit

Permalink
Move chef rest connection to context
Browse files Browse the repository at this point in the history
  • Loading branch information
bmarini committed Sep 27, 2012
1 parent 98a9c4f commit a9bc995
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/health_inspector/checklists/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ def diff(original, other)
end
end

def chef_rest
@rest ||= Chef::REST.new(@context.configure[:chef_server_url], @context.configure[:node_name],
@context.configure[:client_key])
def chef_rest
@context.chef_rest
end

def run_check(check, item)
Expand Down
4 changes: 4 additions & 0 deletions lib/health_inspector/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ def configure
Chef::Config.from_file(config_path)
Chef::Config
end

def chef_rest
@chef_rest ||= Chef::REST.new( config[:chef_server_url], config[:node_name], config[:client_key] )
end
end
end

0 comments on commit a9bc995

Please sign in to comment.