Skip to main content

Chef/Modernize/UseChefLanguageCloudHelpers

Cookstyle cops page

The Cookstyle cops department: Chef/Modernize

Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledYes15.5+

Chef Infra Client 15.5 and later include cloud helpers to make detecting instances that run on public and private clouds easier.

Examples

incorrect

node['cloud']['provider'] == 'alibaba'
node['cloud']['provider'] == 'ec2'
node['cloud']['provider'] == 'gce'
node['cloud']['provider'] == 'rackspace'
node['cloud']['provider'] == 'eucalyptus'
node['cloud']['provider'] == 'linode'
node['cloud']['provider'] == 'openstack'
node['cloud']['provider'] == 'azure'
node['cloud']['provider'] == 'digital_ocean'
node['cloud']['provider'] == 'softlayer'

correct

alibaba?
ec2?
gce?
rackspace?
eucalyptus?
linode?
openstack?
azure?
digital_ocean?
softlayer?

Configurable attributes

NameDefault valueConfigurable values
Version Added7.22.0String
Include
  • **/resources/*.rb
  • **/providers/*.rb
  • **/recipes/*.rb
Array

Thank you for your feedback!

×










Search Results