summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-01-22 14:45:20 -0800
committerGitHub <noreply@github.com>2018-01-22 14:45:20 -0800
commit3ac1a79d775a691e5871417213e73ac86830cae5 (patch)
treed2bee2bc99c844367935626ebb6fe473cb98db24
parentda15ad4803c68dd4e97d7c486e12230892f99e82 (diff)
parent34a09206c12e0bb8b658ebd8a64a76411a17afd6 (diff)
downloadchef-3ac1a79d775a691e5871417213e73ac86830cae5.tar.gz
Merge pull request #6762 from chef/lcg/remove-node-set
Remove node.set and node.set_unless attribute levels
-rw-r--r--lib/chef/node.rb5
-rw-r--r--lib/chef/node/attribute.rb7
-rw-r--r--spec/unit/node_spec.rb16
3 files changed, 2 insertions, 26 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 20134ca11b..7b530e1132 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -199,11 +199,6 @@ class Chef
attributes.normal
end
- def set
- Chef.deprecated(:attributes, "node.set is deprecated and will be removed in Chef 14, please use node.default/node.override (or node.normal only if you really need persistence)")
- normal
- end
-
# Set a default of this node, but auto-vivify any Mashes that might
# be missing
def default
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index 389968f543..142150aeef 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -1,7 +1,7 @@
#--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: AJ Christensen (<aj@chef.io>)
-# Copyright:: Copyright 2008-2017, Chef Software Inc.
+# Copyright:: Copyright 2008-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -446,11 +446,6 @@ class Chef
write(:override, *args) if override.read(*args[0...-1]).nil?
end
- def set_unless(*args)
- Chef.deprecated(:attributes, "node.set_unless is deprecated and will be removed in Chef 14, please use node.default_unless/node.override_unless (or node.normal_unless if you really need persistence)")
- normal_unless(*args)
- end
-
def has_key?(key)
COMPONENTS.any? do |component_ivar|
instance_variable_get(component_ivar).has_key?(key)
diff --git a/spec/unit/node_spec.rb b/spec/unit/node_spec.rb
index 7dc972b5a0..2019f1ac42 100644
--- a/spec/unit/node_spec.rb
+++ b/spec/unit/node_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Adam Jacob (<adam@chef.io>)
-# Copyright:: Copyright 2008-2017, Chef Software Inc.
+# Copyright:: Copyright 2008-2018, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -303,20 +303,6 @@ describe Chef::Node do
expect(node["tags"]).to eq(%w{one two three four})
end
- it "set is a deprecated alias for normal" do
- Chef::Config[:treat_deprecation_warnings_as_errors] = false
- expect(Chef).to receive(:deprecated).with(:attributes, /set is deprecated/)
- node.set[:snoopy][:is_a_puppy] = true
- expect(node.normal[:snoopy][:is_a_puppy]).to eq(true)
- end
-
- it "set_unless is a deprecated alias for normal_unless" do
- Chef::Config[:treat_deprecation_warnings_as_errors] = false
- expect(Chef).to receive(:deprecated).with(:attributes, /set_unless is deprecated/)
- node.set_unless[:snoopy][:is_a_puppy] = false
- expect(node.normal[:snoopy][:is_a_puppy]).to eq(false)
- end
-
it "normal_unless sets a value even if default or override attrs are set" do
node.default[:decontamination] = true
node.override[:decontamination] = false