summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-03-06 15:12:11 -0800
committerJay Mundrawala <jdmundrawala@gmail.com>2015-03-06 15:12:11 -0800
commit9b7474ef929aa7bc762c9f9381d1643673f04091 (patch)
treeaa2f9936301887f8e00b60a96838df4c4c3b98fd
parent7746ad8a12e15c02c2eeb85039ad7962688a33be (diff)
parent4b983f7bb0b32722b216e4e1b5edc78f2f59dd24 (diff)
downloadchef-9b7474ef929aa7bc762c9f9381d1643673f04091.tar.gz
Merge pull request #3019 from ranjib/fix_search
Fix data fetching when explicit attributes are passed
-rw-r--r--lib/chef/knife/search.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/chef/knife/search.rb b/lib/chef/knife/search.rb
index a6cec761ce..9319d30e7d 100644
--- a/lib/chef/knife/search.rb
+++ b/lib/chef/knife/search.rb
@@ -106,8 +106,7 @@ class Chef
formatted_item = Hash.new
if item.is_a?(Hash)
# 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")
+ formatted_item[item["__display_name"]] = item.reject{|k| k == "__display_name"}
else
formatted_item = format_for_display(item)
end