diff options
author | Pete Higgins <pete@peterhiggins.org> | 2020-04-29 17:29:14 -0700 |
---|---|---|
committer | Pete Higgins <pete@peterhiggins.org> | 2020-05-01 11:06:58 -0700 |
commit | 49023657dac85892d9c434a18b6454c16da9f3ed (patch) | |
tree | fd3228e233a0d4ca02cfb15bd659069a7dd9d7e2 | |
parent | 18ca8ca2ec2e09ac5d2ca4b37d8db37ee767c34d (diff) | |
download | chef-49023657dac85892d9c434a18b6454c16da9f3ed.tar.gz |
Allow symbols in yaml conversion.
Signed-off-by: Pete Higgins <pete@peterhiggins.org>
-rw-r--r-- | lib/chef/knife/yaml_convert.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/knife/yaml_convert.rb b/lib/chef/knife/yaml_convert.rb index 92b14da29a..ae82058ab4 100644 --- a/lib/chef/knife/yaml_convert.rb +++ b/lib/chef/knife/yaml_convert.rb @@ -56,7 +56,7 @@ class Chef::Knife::YamlConvert < Chef::Knife end # Unfortunately, per the YAML spec, comments are stripped when we load, so we lose them on conversion - yaml_hash = ::YAML.safe_load(yaml_contents) + yaml_hash = ::YAML.safe_load(yaml_contents, permitted_classes: [Symbol]) unless yaml_hash.is_a?(Hash) && yaml_hash.key?("resources") ui.fatal!("YAML recipe '#{source_file}' must contain a top-level 'resources' hash (YAML sequence), i.e. 'resources:'") end |