Skip to main content

ResourceUsesUpdatedMethod

The department is: ResourceUsesUpdatedMethod

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

Enabled by default Supports autocorrection Target Chef Version
Not Enabled No All Versions

do not call the deprecated updated= method in a resource to set the resource to updated. This method was removed from Chef Infra Client 13 and this will now cause an error. Instead wrap code that updated the state of the node in a converge_by block. Documentation on using the converge_by block can be found at https://docs.chef.io/custom_resources/.

Examples

incorrect

action :foo do
  updated = true
end

correct

action :foo do
  converge_by('resource did something') do
    # code that causes the resource to converge
  end

Configurable attributes

Name Default value Configurable values
Version Added 5.7.0 String
Include
  • **/libraries/*.rb
  • **/providers/*.rb
  • **/resources/*.rb
Array

Was this page helpful?

×









Search Results