Skip to main content

Chef/Deprecations/ResourceOverridesProvidesMethod

Cookstyle cops page

The Cookstyle cops department: Chef/Deprecations

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

Thank you for your feedback!

×











Search Results