Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 676 Bytes

deprecations_run_command.md

File metadata and controls

32 lines (23 loc) · 676 Bytes

+++ title = "Deprecation: Deprecation of run_command (CHEF-14)" draft = false

gh_repo = "chef-web-docs" robots = "noindex" sitemapExclude = true aliases = "/deprecations_run_command.html" +++

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

This deprecation warning was added in Chef Infra Client 12.18.31, and run_command will be removed permanently in Chef Infra 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')