Deprecation: Deprecation of run_command (CHEF-14)

[edit on GitHub]

The old run_command API has been replaced by shell_out (a wrapper around Mixlib::ShellOut).

This deprecation warning was added in Chef Client 12.18.31, and run_command will be removed permanently in Chef Client 13.

Example

Previously to run a command from Chef Infra Client code you might have written:

run_command(command: '/sbin/ifconfig eth0')

Remediation

You now need to use shell_out! instead:

shell_out!('/sbin/ifconfig eth0')

© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/deprecations_run_command/