summaryrefslogtreecommitdiff
path: root/lib/chef/node.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-08 11:44:22 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-09 11:01:45 -0800
commit4d02117a2868426f80ea8b3e561fbc86ad667b97 (patch)
tree727b8b648439ac7a4a948b32caaca7c70e1952e4 /lib/chef/node.rb
parent5f19be6a6bb96ae54507a64ca4742d50ab68d63f (diff)
downloadchef-4d02117a2868426f80ea8b3e561fbc86ad667b97.tar.gz
Wire "force" default and override into node
The desired behavior works without this match because of method_missing on Chef::Node, but this makes the behavior tested, documented, and explicit.
Diffstat (limited to 'lib/chef/node.rb')
-rw-r--r--lib/chef/node.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index b75f08f64a..0c49359236 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -138,6 +138,12 @@ class Chef
attributes.default
end
+ # Set a force default attribute. Intermediate mashes will be created by
+ # auto-vivify if necessary.
+ def default!
+ attributes.default!
+ end
+
# Set a default attribute of this node, auto-vivifying any mashes that are
# missing, but if the final value already exists, don't set it
def default_unless
@@ -151,6 +157,12 @@ class Chef
attributes.override
end
+ # Set a force override attribute. Intermediate mashes will be created by
+ # auto-vivify if needed.
+ def override!
+ attributes.override!
+ end
+
# Set an override attribute of this node, auto-vivifying any mashes that
# are missing, but if the final value already exists, don't set it
def override_unless