diff options
author | Thom May <thom@may.lt> | 2017-03-08 18:00:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-08 18:00:31 +0000 |
commit | 203f8345e16a440c274742bd08b22923f1abc661 (patch) | |
tree | 5cf7b35c4a78124225e5d6213f974bc1991199fe | |
parent | 13d1e44462784f05f81b2285c3baa875a2d6a444 (diff) | |
parent | 3e06d45b8ca670c6cd31d11a14e9708237221c3d (diff) | |
download | chef-203f8345e16a440c274742bd08b22923f1abc661.tar.gz |
Merge pull request #5881 from chef/tm/remove_partial_search
remove partial_search
-rw-r--r-- | lib/chef/search/query.rb | 22 | ||||
-rw-r--r-- | spec/unit/search/query_spec.rb | 18 |
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 |