class Praegustator::Wrappers::Chef
Public Class Methods
search(query)
click to toggle source
# File lib/praegustator/wrappers/chef.rb, line 8 def self.search query ::Chef::Config.from_file(File.expand_path(Praegustator.config['chef']['knife_location'])) chef_query = ::Chef::Search::Query.new nodes = chef_query.search('node',query).first rescue [] $stdout.puts "no node found for search criteria: #{query}" if nodes.empty? nodes.map{|n| Praegustator::Node.new n.name , n.ipaddress ,query} end