Class: RuboCop::Cop::Chef::Deprecations::ResourceUsesUpdatedMethod
- Defined in:
- lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb
Overview
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 docs.chef.io/custom_resources/.
Constant Summary collapse
- MSG =
"Don't use updated = true/false to update resource state. This will cause failures in Chef Infra Client 13 and later."
Instance Method Summary collapse
Methods inherited from Base
Instance Method Details
#on_lvasgn(node) ⇒ Object
41 42 43 |
# File 'lib/rubocop/cop/chef/deprecation/resource_uses_updated_method.rb', line 41 def on_lvasgn(node) add_offense(node, severity: :warning) if node.node_parts.first == :updated end |