chef / chef/chef-cli

`chef shell-init` emits warnings

Open
#219 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Untriaged Type: Bug
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the warning with eval "$(chef shell-init bash)", then inspect lib/chef-cli/command/shell_init.rb at line 125, which is named in the output. Update the deprecated ERB invocation and rerun the command; done means it produces no warnings.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.