summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-09-05 11:24:27 -0700
committerGitHub <noreply@github.com>2018-09-05 11:24:27 -0700
commitcd8ed4a3693d090ec99b7014c4b259e4e4180d40 (patch)
tree9402a007d91e2769f7f778e014b59ad4aeaa3b50
parentd4a752576486054dbe6ad295c30ba509685a95bb (diff)
parent3cfabb7d85c316a7fd4bb3e1bd1e258f2651b48c (diff)
downloadchef-cd8ed4a3693d090ec99b7014c4b259e4e4180d40.tar.gz
Merge pull request #7601 from chef/lcg/better-deprecation
Shorten the resource collision deprecation message
-rw-r--r--lib/chef/node_map.rb14
-rw-r--r--spec/unit/node_map_spec.rb6
2 files changed, 7 insertions, 13 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index a4891234f5..ac60b590b6 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -38,19 +38,13 @@
class Chef
class NodeMap
COLLISION_WARNING_14 = <<~EOH.gsub(/\s+/, " ").strip
- %{type_caps} %{key} has been loaded from a cookbook. The %{type} %{key} is now
- included in Chef and will take precedence over the existing cookbook %{type} in the
- next major release of Chef (15.0, April 2019). You may be able to remove this cookbook dependency from
- your runlist if you do not use other recipes/resources/libraries from the cookbook.
- Alternatively there may be a newer version of this cookbook without the %{key} %{type}.
+ %{type_caps} %{key} from a cookbook is overriding the %{type} from the client. Please upgrade your cookbook
+ or remove the cookbook from your run_list before the next major release of Chef.
EOH
COLLISION_WARNING_15 = <<~EOH.gsub(/\s+/, " ").strip
- %{type_caps} %{key} attempted to load from a cookbook. The %{type} %{key} is now
- included in Chef and takes precedence over the existing cookbook %{type}
- which will be ignored. You may be able to remove this cookbook dependency from
- your runlist if you do not use other recipes/resources/libraries from the cookbook.
- Alternatively there may be a newer version of this cookbook without the %{key} %{type}.
+ %{type_caps} %{key} from the client is overriding the %{type} from a cookbook. Please upgrade your cookbook
+ or remove the cookbook from your run_list.
EOH
#
diff --git a/spec/unit/node_map_spec.rb b/spec/unit/node_map_spec.rb
index df70ad380a..9c161f3893 100644
--- a/spec/unit/node_map_spec.rb
+++ b/spec/unit/node_map_spec.rb
@@ -223,7 +223,7 @@ describe Chef::NodeMap do
context "while locked" do
# Uncomment the commented `expect`s in 15.0.
it "rejects setting the same key twice" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /resource foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Resource foo/)
node_map.set(:foo, FooResource)
node_map.lock!
node_map.set(:foo, BarResource)
@@ -247,7 +247,7 @@ describe Chef::NodeMap do
end
it "rejects setting the same key twice when the first has allow_cookbook_override with a past version" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /resource foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Resource foo/)
node_map.set(:foo, FooResource, allow_cookbook_override: "< 1")
node_map.lock!
node_map.set(:foo, BarResource)
@@ -263,7 +263,7 @@ describe Chef::NodeMap do
end
it "rejects setting the same key twice for a provider" do
- expect(Chef).to receive(:deprecated).with(:map_collision, /provider foo/)
+ expect(Chef).to receive(:deprecated).with(:map_collision, /Provider foo/)
node_map.set(:foo, FooProvider)
node_map.lock!
node_map.set(:foo, BarProvider)