NodeNormalUnless

All Cookstyle Cops


The department is: Chef/Correctness

The full name of the cop is: Chef/Correctness/NodeNormalUnless


Enabled by default Supports autocorrection Target Chef Version
Enabled No All Versions

Normal attributes are discouraged since their semantics differ importantly from the default and override levels. Their values persist in the node object even after all code referencing them has been deleted, unlike default and override.

Code should be updated to use default or override levels, but this will change attribute merging behavior so needs to be validated manually and force_default or force_override levels may need to be used in recipe code.

Examples

incorrect

node.normal_unless['foo'] = true

correct

node.default_unless['foo'] = true
node.override_unless['foo'] = true
node.force_default_unless['foo'] = true
node.force_override_unless['foo'] = true

Configurable attributes

Name Default value Configurable values
Version Added 5.1.0 String
Exclude
  • **/metadata.rb
  • **/Berksfile
Array

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/workstation/cookstyle/chef_correctness_nodenormalunless/