diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-20 19:53:30 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-20 19:53:30 -0700 |
commit | 6fa5b322372ebb284ac9dc08ea2b0952f56262c3 (patch) | |
tree | 640a5280890d050a3724564be9b38a5d6a9d96db | |
parent | 422d5720de5401fac3e52f50d63507f11765e8fe (diff) | |
download | chef-6fa5b322372ebb284ac9dc08ea2b0952f56262c3.tar.gz |
Chef-13: remove node_map back-compat
removes old Chef-10 era APIs that were not widely used.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r-- | lib/chef/node_map.rb | 7 | ||||
-rw-r--r-- | spec/unit/node_map_spec.rb | 24 |
2 files changed, 3 insertions, 28 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb index 552c90b8d1..7a1a09ae24 100644 --- a/lib/chef/node_map.rb +++ b/lib/chef/node_map.rb @@ -1,6 +1,6 @@ # # Author:: Lamont Granquist (<lamont@chef.io>) -# Copyright:: Copyright 2014-2016, Chef Software, Inc. +# Copyright:: Copyright 2014-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,10 +31,7 @@ class Chef # # @return [NodeMap] Returns self for possible chaining # - def set(key, value, platform: nil, platform_version: nil, platform_family: nil, os: nil, on_platform: nil, on_platforms: nil, canonical: nil, override: nil, &block) - Chef.deprecated(:internal_api, "The on_platform option to node_map has been deprecated") if on_platform - Chef.deprecated(:internal_api, "The on_platforms option to node_map has been deprecated") if on_platforms - platform ||= on_platform || on_platforms + def set(key, value, platform: nil, platform_version: nil, platform_family: nil, os: nil, canonical: nil, override: nil, &block) filters = {} filters[:platform] = platform if platform filters[:platform_version] = platform_version if platform_version diff --git a/spec/unit/node_map_spec.rb b/spec/unit/node_map_spec.rb index 0480a721af..822f689eab 100644 --- a/spec/unit/node_map_spec.rb +++ b/spec/unit/node_map_spec.rb @@ -1,6 +1,6 @@ # # Author:: Lamont Granquist (<lamont@chef.io>) -# Copyright:: Copyright 2014-2016, Chef Software, Inc. +# Copyright:: Copyright 2014-2017, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -145,26 +145,4 @@ describe Chef::NodeMap do end end - describe "resource back-compat testing" do - before :each do - Chef::Config[:treat_deprecation_warnings_as_errors] = false - end - - it "should handle :on_platforms => :all" do - node_map.set(:chef_gem, :foo, :on_platforms => :all) - allow(node).to receive(:[]).with(:platform).and_return("windows") - expect(node_map.get(node, :chef_gem)).to eql(:foo) - end - it "should handle :on_platforms => [ 'windows' ]" do - node_map.set(:dsc_script, :foo, :on_platforms => [ "windows" ]) - allow(node).to receive(:[]).with(:platform).and_return("windows") - expect(node_map.get(node, :dsc_script)).to eql(:foo) - end - it "should handle :on_platform => :all" do - node_map.set(:link, :foo, :on_platform => :all) - allow(node).to receive(:[]).with(:platform).and_return("windows") - expect(node_map.get(node, :link)).to eql(:foo) - end - end - end |