diff options
author | Thom May <thom@may.lt> | 2017-03-21 07:24:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 07:24:57 +0000 |
commit | 13875456002a18686325a8bf3bc7c308d4698b76 (patch) | |
tree | 2ce30133c1f4d4c49cd7537bd791a6434976f1ca | |
parent | 45df5a2bbd4de40330aa21266779ed129bd83fb7 (diff) | |
parent | 6fa5b322372ebb284ac9dc08ea2b0952f56262c3 (diff) | |
download | chef-13875456002a18686325a8bf3bc7c308d4698b76.tar.gz |
Merge pull request #5926 from chef/lcg/deprecated-node-map-apis
Chef-13: remove node_map back-compat
-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 |