[chef] search in 0.9.8


Chronological Thread 
  • From: Mike Scherbakov < >
  • To:
  • Subject: [chef] search in 0.9.8
  • Date: Mon, 27 Sep 2010 13:55:26 +0400

Hi, 

What changes I missed in search statement syntax?
I'm trying to use search to find all nodes which have hpc::client recipe in chef 0.9.8:

clients = search(:node, "recipe:hpc::client)
but getting Internal Server Error. In 0.8.x versions it worked. In log file on the chef server: 
FATAL: Search Query to Solr '/solr/select?rows=1000&sort=X_CHEF_id_CHEF_X+asc&start=0&indent=off&wt=ruby&fq=%2BX_CHEF_database_CHEF_X%3Achef+%2BX_CHEF_type_CHEF_X%3Anode&q=%2A' failed

clients = search(:node, "recipe:hpc") works just fine. I also tried "run_list:recipe\[hpc::client\]", the same error. What is the right way to use search? 

As a temporary solution, I use following _expression_:
clients = search(:node, "*:*").select { |e| e.run_list.run_list_items.select{ |i| i.name == "hpc::client" }.any? }.map{ |e| e["ipaddress"] }

Thanks,
--
Mike Scherbakov,
Grid Dynamics



Archive powered by MHonArc 2.6.16.

§