summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2017-03-08 13:49:24 +0000
committerThom May <thom@chef.io>2017-03-08 13:49:24 +0000
commit3e06d45b8ca670c6cd31d11a14e9708237221c3d (patch)
treeee89c54a79b5528f49dc9375aad91a27bf37ce9a
parent85be50a9ddbcf0334884c922813e17c6f450e838 (diff)
downloadchef-3e06d45b8ca670c6cd31d11a14e9708237221c3d.tar.gz
remove partial_searchtm/remove_partial_search
Signed-off-by: Thom May <thom@chef.io>
-rw-r--r--lib/chef/search/query.rb22
-rw-r--r--spec/unit/search/query_spec.rb18
2 files changed, 0 insertions, 40 deletions
diff --git a/lib/chef/search/query.rb b/lib/chef/search/query.rb
index bea8205935..fb77238ced 100644
--- a/lib/chef/search/query.rb
+++ b/lib/chef/search/query.rb
@@ -39,28 +39,6 @@ class Chef
@rest ||= Chef::ServerAPI.new(@url || @config[:chef_server_url])
end
- # Backwards compatability for cookbooks.
- # This can be removed in Chef > 12.
- def partial_search(type, query = "*:*", *args, &block)
- Chef::Log.warn(<<-WARNDEP)
-DEPRECATED: The 'partial_search' API is deprecated and will be removed in
-future releases. Please use 'search' with a :filter_result argument to get
-partial search data.
-WARNDEP
-
- if !args.empty? && args.first.is_a?(Hash)
- # partial_search uses :keys instead of :filter_result for
- # result filtering.
- args_h = args.first.dup
- args_h[:filter_result] = args_h[:keys]
- args_h.delete(:keys)
-
- search(type, query, args_h, &block)
- else
- search(type, query, *args, &block)
- end
- end
-
#
# New search input, designed to be backwards compatible with the old method signature
# 'type' and 'query' are the same as before, args now will accept either a Hash of
diff --git a/spec/unit/search/query_spec.rb b/spec/unit/search/query_spec.rb
index 51667784fb..6df8587717 100644
--- a/spec/unit/search/query_spec.rb
+++ b/spec/unit/search/query_spec.rb
@@ -269,22 +269,4 @@ describe Chef::Search::Query do
end
end
- describe "#partial_search" do
- include_context "filtered search" do
- let(:filter_key) { :keys }
-
- it "emits a deprecation warning" do
- # partial_search calls search, so we'll stub search to return empty
- allow(query).to receive(:search).and_return( [ [], 0, 0 ] )
- expect(Chef::Log).to receive(:warn).with(/DEPRECATED: The 'partial_search' API is deprecated/)
- query.partial_search(:node, "platform:rhel", args)
- end
-
- it "returns an array of filtered hashes" do
- expect(rest).to receive(:post).with(query_string, args[filter_key]).and_return(response)
- results = query.partial_search(:node, "platform:rhel", args)
- expect(results[0]).to match_array(response_rows)
- end
- end
- end
end