Skip to main content

Chef/Deprecations/NodeSetWithoutLevel

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

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
Include
    Array

    Thank you for your feedback!

    ×