Skip to main content

NodeSetWithoutLevel

All Cookstyle Cops


The department is: Chef/Deprecations

The full name of the cop is: Chef/Deprecations/NodeSetWithoutLevel


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNoAll Versions

When setting a node attribute in Chef Infra Client 11 and later you must specify the precedence level.

Examples

incorrect

node['foo']['bar'] = 1
node['foo']['bar'] << 1
node['foo']['bar'] += 1
node['foo']['bar'] -= 1

correct

node.default['foo']['bar'] = 1
node.default['foo']['bar'] << 1
node.default['foo']['bar'] += 1
node.default['foo']['bar'] -= 1

Configurable attributes

NameDefault valueConfigurable values
Version Added5.13.0String
Exclude
  • **/metadata.rb
  • **/attributes/*.rb
Array

Was this page helpful?









Search Results