Skip to main content

UsesRunCommandHelper

All Cookstyle Cops


The department is: Chef/Deprecations

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


Enabled by default Supports autocorrection Target Chef Version
Enabled No All Versions

Use ‘shell_out!’ instead of the legacy ‘run_command’ or ‘run_command_with_systems_locale’ helpers for shelling out. The run_command helper was removed in Chef Infra Client 13.

Examples

incorrect

require 'chef/mixin/command'
include Chef::Mixin::Command

run_command('/bin/foo')
run_command_with_systems_locale('/bin/foo')

correct

shell_out!('/bin/foo')

Configurable attributes

Name Default value Configurable values
Version Added 5.9.0 String
Exclude
  • **/metadata.rb
  • **/Berksfile
  • **/Rakefile
Array

Was this page helpful?

×








Search Results