diff options
author | Noah Kantrowitz <noah@coderanger.net> | 2015-07-23 09:55:19 -0700 |
---|---|---|
committer | Noah Kantrowitz <noah@coderanger.net> | 2015-07-23 09:55:19 -0700 |
commit | 694c4d6af2e0a14d5fc6e59718f0aa9dfeb15c89 (patch) | |
tree | d041fb07b07e7153704c93bc0a182de78a572c8c | |
parent | 5daf096d9e97a8b7de9af805b7f5a1f38ff5b0ba (diff) | |
parent | 9003cc172248fe2c89771486dc3e2cada090df2e (diff) | |
download | chef-694c4d6af2e0a14d5fc6e59718f0aa9dfeb15c89.tar.gz |
Merge pull request #3684 from coderanger/remove-warning
Remove warnings about hander overrides.
-rw-r--r-- | lib/chef/platform/handler_map.rb | 5 | ||||
-rw-r--r-- | spec/integration/recipes/recipe_dsl_spec.rb | 15 | ||||
-rw-r--r-- | spec/unit/recipe_spec.rb | 4 |
3 files changed, 0 insertions, 24 deletions
diff --git a/lib/chef/platform/handler_map.rb b/lib/chef/platform/handler_map.rb index 001eb3dc8f..a9551a344b 100644 --- a/lib/chef/platform/handler_map.rb +++ b/lib/chef/platform/handler_map.rb @@ -31,11 +31,6 @@ class Chef # are exactly equal if new_matcher[:value].is_a?(Class) && !new_matcher[:override] cmp = compare_matcher_properties(new_matcher, matcher) { |m| m[:value].name } - if cmp < 0 - Chef::Log.warn "You are overriding #{key} on #{new_matcher[:filters].inspect} with #{new_matcher[:value].inspect}: used to be #{matcher[:value].inspect}. Use override: true if this is what you intended." - elsif cmp > 0 - Chef::Log.warn "You declared a new resource #{new_matcher[:value].inspect} for resource #{key}, but it comes alphabetically after #{matcher[:value].inspect} and has the same filters (#{new_matcher[:filters].inspect}), so it will not be used. Use override: true if you want to use it for #{key}." - end end end cmp diff --git a/spec/integration/recipes/recipe_dsl_spec.rb b/spec/integration/recipes/recipe_dsl_spec.rb index a4de6ae542..fd40e5b6d8 100644 --- a/spec/integration/recipes/recipe_dsl_spec.rb +++ b/spec/integration/recipes/recipe_dsl_spec.rb @@ -794,21 +794,6 @@ describe "Recipe DSL methods" do end end - context "when Thingy9 provides :thingy9" do - before(:context) { - class RecipeDSLSpecNamespace::Thingy9 < BaseThingy - resource_name :thingy9 - end - } - - it "declaring a resource providing the same :thingy9 produces a warning" do - expect(Chef::Log).to receive(:warn).with("You declared a new resource RecipeDSLSpecNamespace::Thingy9AlternateProvider for resource thingy9, but it comes alphabetically after RecipeDSLSpecNamespace::Thingy9 and has the same filters ({}), so it will not be used. Use override: true if you want to use it for thingy9.") - class RecipeDSLSpecNamespace::Thingy9AlternateProvider < BaseThingy - resource_name :thingy9 - end - end - end - context "when Thingy10 provides :thingy10" do before(:context) { class RecipeDSLSpecNamespace::Thingy10 < BaseThingy diff --git a/spec/unit/recipe_spec.rb b/spec/unit/recipe_spec.rb index 511e7e9397..ea3ab44c16 100644 --- a/spec/unit/recipe_spec.rb +++ b/spec/unit/recipe_spec.rb @@ -154,8 +154,6 @@ describe Chef::Recipe do end it "selects the first one alphabetically" do - expect(Chef::Log).to receive(:warn).with("You declared a new resource TottenhamHotspur for resource football, but it comes alphabetically after Sounders and has the same filters ({:platform=>\"nbc_sports\"}), so it will not be used. Use override: true if you want to use it for football.") - Sounders.provides :football, platform: "nbc_sports" TottenhamHotspur.provides :football, platform: "nbc_sports" @@ -165,8 +163,6 @@ describe Chef::Recipe do end it "selects the first one alphabetically even if the declaration order is reversed" do - expect(Chef::Log).to receive(:warn).with("You are overriding football2 on {:platform=>\"nbc_sports\"} with Sounders: used to be TottenhamHotspur. Use override: true if this is what you intended.") - TottenhamHotspur.provides :football2, platform: "nbc_sports" Sounders.provides :football2, platform: "nbc_sports" |