chef-workstation icon indicating copy to clipboard operation
chef-workstation copied to clipboard

--json-attributes causes JSON::ParserError from Chef DK prompt

Open tpetchel opened this issue 8 years ago • 3 comments

Description

knife commands that use --json-attributes fail with JSON::ParserError from a Chef DK prompt but succeed from a standard PowerShell prompt. For example:

$ knife bootstrap windows winrm 54.84.99.135 --winrm-user Administrator --winrm-password 'masked' --json-attributes $public_ip

See this Gist for a side-by-side comparison:

https://gist.github.com/tpetchel/7ee1687f570769938c1886a81b362cc6

Impact: We demonstrate the use of --json-attributes on Learn Chef (example). We also encourage the use of the Chef DK command prompt.

ChefDK Version

$ chef --version
Chef Development Kit Version: 2.0.28
chef-client version: 13.2.20
delivery version: master (17c1b0fed9be4c70f69091a6d21a4cbf0df60a23)
berks version: 6.2.0
kitchen version: 1.16.0
inspec version: 1.31.1

Platform Version

Windows 10

Replication Case

See the above Gist.

Stacktrace

See the above Gist.

tpetchel avatar Oct 19 '17 01:10 tpetchel

Does it work in Bash on Mac/Linux?

coderanger avatar Oct 19 '17 01:10 coderanger

Ahh never mind, I see it's not an issue with Chef itself, it's some kind of double quoting problem in the shell?

coderanger avatar Oct 19 '17 01:10 coderanger

Moving this to Chef Workstation. We need to go try and repro this to see if it is still an issue

tyler-ball avatar Feb 05 '20 18:02 tyler-ball