DatabagHelpers
The department is: Chef/Modernize
The full name of the cop is: Chef/Modernize/DatabagHelpers
Enabled by default | Supports autocorrection | Target Chef Version |
---|---|---|
Enabled | Yes | All 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
Name | Default value | Configurable values |
---|---|---|
Version Added | 6.0.0 | String | Exclude |
| Array |
Was this page helpful?