Skip to main content

ResourceOverridesProvidesMethod

The department is: ResourceOverridesProvidesMethod

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

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNoAll Versions

Some providers in resources override the provides? method, used to check whether they are a valid provider on the current platform. In Chef Infra Client 13, this will cause an error. Instead use provides :SOME_PROVIDER_NAME to register the provider.

Examples

incorrect

def provides?
 true
end

correct

provides :SOME_PROVIDER_NAME

Configurable attributes

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

Was this page helpful?

×









Search Results