diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-12 14:11:00 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-05-12 14:11:00 -0700 |
commit | 339fae5b801086da51f875b65d805a3d9b6fd85f (patch) | |
tree | c3075f58b8eae5bccaad64d5b0e31fc53e7126f0 | |
parent | 34a2e6e8bae46e2b7eb83135d4d40318792ad85a (diff) | |
download | chef-lcg/wipe-normal-attrs.tar.gz |
WIP: wiping normal attrslcg/wipe-normal-attrs
-rw-r--r-- | lib/chef/config.rb | 4 | ||||
-rw-r--r-- | lib/chef/node.rb | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/chef/config.rb b/lib/chef/config.rb index f9a3289b30..4c7a8c680c 100644 --- a/lib/chef/config.rb +++ b/lib/chef/config.rb @@ -552,6 +552,10 @@ class Chef # immediately if 0.) default :run_lock_timeout, nil + # Setting this to false will clean normal attributes at the start of the chef + # run similarly to automatic, default and override. + default :persist_normal_attributes, true + # If installed via an omnibus installer, this gives the path to the # "embedded" directory which contains all of the software packaged with # omnibus. This is used to locate the cacert.pem file on windows. diff --git a/lib/chef/node.rb b/lib/chef/node.rb index 6061dbe615..4cbe7182b3 100644 --- a/lib/chef/node.rb +++ b/lib/chef/node.rb @@ -342,6 +342,14 @@ class Chef def reset_defaults_and_overrides self.default.clear self.override.clear + saved = {} + [:tags, :run_list].each do |attr| + saved[attr] = self.normal[attr] + end + self.normal.clear + [:tags, :run_list].each do |attr| + self.normal[attr] = saved[attr] + end end # Expands the node's run list and sets the default and override |