diff options
author | Jeremy J. Miller <jm@chef.io> | 2017-07-17 15:43:19 -0400 |
---|---|---|
committer | Jeremy J. Miller <jm@chef.io> | 2017-07-17 21:20:28 -0400 |
commit | 6b34164ae2783ae698802434e28c466c1a5b8754 (patch) | |
tree | ca8f6bcb2a03dd9ab61e99e3b581e6678ec5a656 /lib/chef/knife | |
parent | 81fff868e720b519c39dacf8f09121416acbbff5 (diff) | |
download | chef-6b34164ae2783ae698802434e28c466c1a5b8754.tar.gz |
avoid mutation attempt of node['platform']
Fixes https://github.com/chef/chef/issues/6277
Added `node['platform']` and `node['platform_version']` attributes in
the unit tests to trigger a "can't modify frozen String" error.
Fixed by doing shallow copy of `node['platform']` on assignment.
Signed-off-by: Jeremy J. Miller <jm@chef.io>
Diffstat (limited to 'lib/chef/knife')
-rw-r--r-- | lib/chef/knife/core/status_presenter.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/core/status_presenter.rb b/lib/chef/knife/core/status_presenter.rb index df6c2fe942..f55f9abcbb 100644 --- a/lib/chef/knife/core/status_presenter.rb +++ b/lib/chef/knife/core/status_presenter.rb @@ -123,7 +123,7 @@ class Chef line_parts << run_list if run_list if node["platform"] - platform = node["platform"] + platform = node["platform"].dup if node["platform_version"] platform << " #{node['platform_version']}" end |