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:39:54 -0800
commitde513403180ee04290b2d462e9868847addf1077 (patch)
treec079fab8778f7a5937d70c76b7e6d9df6ac4201e
parentc66c5b66079934a51307907c15f4443235201d7b (diff)
downloadchef-de513403180ee04290b2d462e9868847addf1077.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