summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-01-11 14:09:59 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-01-11 14:09:59 -0800
commit34797a6f6353d7111043e9a0e814d7b30090c5e1 (patch)
treed5a28a7b8d87d24d6603ce17ab21e34820252f3c /lib
parent14d3f5aeb6b163cc2652db3c5724465cac9959e9 (diff)
downloadchef-34797a6f6353d7111043e9a0e814d7b30090c5e1.tar.gz
fix node attribute "unless" API methods
closes #5556 corrects behavior to 12.11.x behavior which was lost in the refactor may address #5715 Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/node/attribute.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/chef/node/attribute.rb b/lib/chef/node/attribute.rb
index d2816d4824..16d3e0b27b 100644
--- a/lib/chef/node/attribute.rb
+++ b/lib/chef/node/attribute.rb
@@ -1,4 +1,4 @@
-#--
+#la--
# Author:: Adam Jacob (<adam@chef.io>)
# Author:: AJ Christensen (<aj@chef.io>)
# Copyright:: Copyright 2008-2016, Chef Software, Inc.
@@ -416,23 +416,22 @@ class Chef
def normal_unless(*args)
return Decorator::Unchain.new(self, :normal_unless) unless args.length > 0
- write(:normal, *args) if read(*args[0...-1]).nil?
+ write(:normal, *args) if normal.read(*args[0...-1]).nil?
end
def default_unless(*args)
return Decorator::Unchain.new(self, :default_unless) unless args.length > 0
- write(:default, *args) if read(*args[0...-1]).nil?
+ write(:default, *args) if default.read(*args[0...-1]).nil?
end
def override_unless(*args)
return Decorator::Unchain.new(self, :override_unless) unless args.length > 0
- write(:override, *args) if read(*args[0...-1]).nil?
+ 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)")
- return Decorator::Unchain.new(self, :default_unless) unless args.length > 0
- write(:normal, *args) if read(*args[0...-1]).nil?
+ normal_unless(*args)
end
def has_key?(key)