Skip to main content

Chef/Deprecations/NodeMethodsInsteadofAttributes

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Use node attributes to access data provided by Ohai instead of using node methods to access that data.

Examples

incorrect

node.fqdn
node.platform
node.platform_family
node.platform_version
node.hostname

correct

node['fqdn']
node['platform']
node['platform_family']
node['platform_version']
node['hostname']

Configurable attributes

NameDefault valueConfigurable values
Version Added5.4.0String
Include
    Array

    Thank you for your feedback!

    ×











    Search Results