vendored/puppet/lib/puppet/application/lookup.rb in bolt-0.17.1 vs vendored/puppet/lib/puppet/application/lookup.rb in bolt-0.17.2
- old
+ new
@@ -333,10 +333,20 @@
# If we want to lookup the node we are currently on
# we must returning these settings to their default values
Puppet.settings[:facts_terminus] = 'facter'
end
- node = Puppet::Node.indirection.find(node) unless node.is_a?(Puppet::Node) # to allow unit tests to pass a node instance
+ unless node.is_a?(Puppet::Node) # to allow unit tests to pass a node instance
+ ni = Puppet::Node.indirection
+ tc = ni.terminus_class
+ if tc == :plain || options[:compile]
+ node = ni.find(node)
+ else
+ ni.terminus_class = :plain
+ node = ni.find(node)
+ ni.terminus_class = tc
+ end
+ end
fact_file = options[:fact_file]
if fact_file
if fact_file.end_with?("json")