Skip to main content

ResourceUsesUpdatedMethod

The department is: ResourceUsesUpdatedMethod

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

Enabled by defaultSupports autocorrectionTarget Chef Version
Not EnabledNoAll Versions

Don’t 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

NameDefault valueConfigurable values
Version Added5.7.0String
Include
  • **/libraries/*.rb
  • **/providers/*.rb
  • **/resources/*.rb
Array

Thank you for your feedback!

×









Search Results