vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb in bolt-0.17.1 vs vendored/puppet/lib/puppet/pops/loader/task_instantiator.rb in bolt-0.17.2

- old
+ new

@@ -25,15 +25,15 @@ create_task(loader, name, task_source, metadata) end def self.create_task(loader, name, task_source, metadata) if metadata.nil? - create_task_from_hash(loader, name, task_source, EMPTY_HASH) + create_task_from_hash(name, task_source, EMPTY_HASH) else json_text = loader.get_contents(metadata) begin - create_task_from_hash(loader, name, task_source, JSON.parse(json_text) || EMPTY_HASH) + create_task_from_hash(name, task_source, JSON.parse(json_text) || EMPTY_HASH) rescue JSON::ParserError => ex raise Puppet::ParseError.new(ex.message, metadata) rescue Types::TypeAssertionError => ex # Not strictly a parser error but from the users perspective, the file content didn't parse properly. The # ParserError also conveys file info (even though line is unknown) @@ -41,21 +41,21 @@ raise Puppet::ParseError.new(msg, metadata) end end end - def self.create_task_from_hash(loader, name, task_source, hash) + def self.create_task_from_hash(name, task_source, hash) arguments = { 'name' => name, 'executable' => task_source } hash.each_pair do |key, value| if 'parameters' == key || 'output' == key ps = {} value.each_pair do |k, v| pd = v.dup t = v['type'] - pd['type'] = t.nil? ? Types::TypeFactory.data : Types::TypeParser.singleton.parse(t, loader) + pd['type'] = t.nil? ? Types::TypeFactory.data : Types::TypeParser.singleton.parse(t) ps[k] = pd end value = ps end arguments[key] = value