| There are a few different things going on here: 1. The yaml_settings module generates a YAML hash where the keys are arrays https://github.com/cataphract/puppet-yaml_settings/blob/bbd6a9210233be03d29b9d0fa423f3fdcdae7452/lib/puppet/type/yaml_settings.rb#L146-L147 That's allowed in the YAML specification, but not JSON:
$ bx ruby -rjson -e "puts JSON.parse('{[1] => 2}')" |
Traceback (most recent call last): |
2: from -e:1:in `<main>' |
1: from /home/josh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/json-2.5.1/lib/json/common.rb:216:in `parse' |
/home/josh/.rbenv/versions/2.7.3/lib/ruby/gems/2.7.0/gems/json-2.5.1/lib/json/common.rb:216:in `parse': 809: unexpected token at '{[1] => 2}' (JSON::ParserError)
|
2. The prefix passed to ToDataSerializer is the string representation of the Persistence object, which causes the message to contain: <Puppet::Transaction::Persistence:0x00005598a2c1ebf8>. That should be fixed 3. There's a bug in the ToDataSerializer which loses track of the current path, so we get repeated elements in the warning message:
['resources']['Yaml_settings[cassandra::config]']['parameters']['values']['system_value'][0] contains a hash with an Array key. It will be converted to the String '["listen_address"]' |
['resources']['Yaml_settings[cassandra::config]']['parameters']['values']['system_value'][0]['resources']['Yaml_settings[cassandra::config]']['parameters']['values']['system_value'][0] contains a hash with an Array key. It will be converted to the String '["broadcast_rpc_address"]'
|
|