chef-cli
chef-cli copied to clipboard
`chef shell-init` emits warnings
Version:
Chef Workstation version: 23.2.1028 Cookstyle version: 7.32.1 Chef Infra Client version: 18.0.185 Chef InSpec version: 5.18.14 Chef CLI version: 5.6.8 Chef Habitat version: 1.6.521 Test Kitchen version: 3.5.0
Environment:
Running on el8
Scenario:
Using chef-workstation in our jenkins pipeline to test cookbooks. While these are just warnings, it does produce noise in our builds.
Steps to Reproduce:
eval "$(chef shell-init bash)"
Expected Result:
No output
Actual Result:
$ eval "$(chef shell-init bash)"
/opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-cli-5.6.8/lib/chef-cli/command/shell_init.rb:125: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
/opt/chef-workstation/embedded/lib/ruby/gems/3.1.0/gems/chef-cli-5.6.8/lib/chef-cli/command/shell_init.rb:125: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
This change seems to have worked:
$ diff shell_init.rb /tmp/shell_init.rb
125c125
< erb = ERB.new(File.read(completion_template_path), nil, "-")
---
> erb = ERB.new(File.read(completion_template_path), trim_mode: '-')