Skip to main content

DeprecatedShelloutMethods

All Cookstyle Cops


The department is: Chef/Deprecations

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


Enabled by defaultSupports autocorrectionTarget Chef Version
EnabledNo14.3+

The large number of shell_out helper methods in Chef Infra Client has been reduced to just shell_out and shell_out! methods. The legacy methods were removed in Chef Infra Client and cookbooks using these legacy helpers will need to be updated.

Examples

incorrect

shell_out_compact('foo')
shell_out_compact!('foo')
shell_out_with_timeout('foo')
shell_out_with_timeout!('foo')
shell_out_with_systems_locale('foo')
shell_out_with_systems_locale!('foo')
shell_out_compact_timeout('foo')
shell_out_compact_timeout!('foo')

correct

shell_out('foo')
shell_out!('foo')
shell_out!('foo', default_env: false) # replaces shell_out_with_systems_locale

Configurable attributes

NameDefault valueConfigurable values
Version Added6.3.0String
Exclude
  • **/metadata.rb
  • **/attributes/*.rb
  • **/Berksfile
Array

Was this page helpful?