vendored/puppet/lib/puppet/application/lookup.rb in bolt-0.8.0 vs vendored/puppet/lib/puppet/application/lookup.rb in bolt-0.9.0

- old
+ new

@@ -338,21 +338,19 @@ node = Puppet::Node.indirection.find(node) unless node.is_a?(Puppet::Node) # to allow unit tests to pass a node instance fact_file = options[:fact_file] if fact_file - original_facts = node.parameters if fact_file.end_with?("json") given_facts = JSON.parse(Puppet::FileSystem.read(fact_file, :encoding => 'utf-8')) else given_facts = YAML.load(Puppet::FileSystem.read(fact_file, :encoding => 'utf-8')) end unless given_facts.instance_of?(Hash) raise _("Incorrect formatted data in %{fact_file} given via the --facts flag") % { fact_file: fact_file } end - - node.parameters = original_facts.merge(given_facts) + node.add_extra_facts(given_facts) end Puppet[:code] = 'undef' unless options[:compile] compiler = Puppet::Parser::Compiler.new(node) compiler.compile { |catalog| yield(compiler.topscope); catalog }