vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb in bolt-0.23.0 vs vendored/puppet/lib/puppet/pops/serialization/from_data_converter.rb in bolt-0.24.0
- old
+ new
@@ -133,10 +133,11 @@
unless @allow_unresolved
raise SerializationError, _('No implementation mapping found for Puppet Type %{type_name}') % { type_name: type_value }
end
hash
else
+ # not a string
pcore_type_hash_to_value(type, value)
end
end
end
end
@@ -148,10 +149,10 @@
#
# @api public
def convert(value)
if value.is_a?(Hash)
pcore_type = value[PCORE_TYPE_KEY]
- if pcore_type
+ if pcore_type && (pcore_type.is_a?(String) || pcore_type.is_a?(Hash))
@pcore_type_procs[pcore_type].call(value, pcore_type)
else
build({}) { value.each_pair { |key, elem| with(key) { convert(elem) }}}
end
elsif value.is_a?(Array)