Skip to main content

Chef/Modernize/DatabagHelpers

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYesAll Versions

Use the data_bag_item helper instead of Chef::DataBagItem.load or Chef::EncryptedDataBagItem.load.

Examples

incorrect

plain_text_data = Chef::DataBagItem.load('foo', 'bar')
encrypted_data = Chef::EncryptedDataBagItem.load('foo2', 'bar2')

correct

plain_text_data = data_bag_item('foo', 'bar')
encrypted_data = data_bag_item('foo2', 'bar2')

Configurable attributes

NameDefault valueConfigurable values
Version Added6.0.0String
Include
    Array

    Thank you for your feedback!

    ×









    Search Results