diff options
author | Scott Hain <shain@getchef.com> | 2014-07-29 15:22:00 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-09-04 15:52:24 -0700 |
commit | 260278d883c86dfab0c9bb933bdbe91cae752a3f (patch) | |
tree | 97eb73c2c708500ed6afa9932260ed28761feaf9 | |
parent | f294010caf2369da57a9950718962ee92126f478 (diff) | |
download | chef-260278d883c86dfab0c9bb933bdbe91cae752a3f.tar.gz |
Added logic to enable -a to utilize search filtering, for performances's sake
-rw-r--r-- | lib/chef/knife/search.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/chef/knife/search.rb b/lib/chef/knife/search.rb index 3eec1bd02c..34d12168b6 100644 --- a/lib/chef/knife/search.rb +++ b/lib/chef/knife/search.rb @@ -105,7 +105,9 @@ class Chef q.search(@type, escaped_query, search_args) do |item| formatted_item = Hash.new if item.is_a?(Hash) - formatted_item[item["url"]] = item["data"] + # doing a little magic here to set the correct name + formatted_item[item["data"]["__display_name"]] = item["data"] + formatted_item[item["data"]["__display_name"]].delete("__display_name") else formatted_item = format_for_display(item) end @@ -132,10 +134,6 @@ class Chef end end - def munge_return_data(item) - - end - def read_cli_args if config[:query] if @name_args[1] @@ -192,8 +190,10 @@ class Chef def create_result_filter_from_attributes(filter_array) final_filter = Hash.new filter_array.each do |f| - final_filter[f.to_sym] = f.split(".") + final_filter[f] = f.split(".") end + # adding magic filter so we can actually pull the name as before + final_filter["__display_name"] = [ "name" ] return final_filter end |