Skip to main content

UseChefLanguageCloudHelpers

All Cookstyle Cops


The department is: Chef/Modernize

The full name of the cop is: Chef/Modernize/UseChefLanguageCloudHelpers


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

Was this page helpful?

×








Search Results