Skip to main content

NodeMethodsInsteadofAttributes

The department is: NodeMethodsInsteadofAttributes

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

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