summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/compiler.rb
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-06-02 15:29:31 -0700
committerMax Martin <max@puppetlabs.com>2011-06-02 15:29:31 -0700
commit284113707fa07c6abcbb765dcd6d8c24e1b6b5fa (patch)
treece31cee8a359e0bb707dc563329acf95c015566d /lib/puppet/parser/compiler.rb
parent2f8bc2688ee5a612e5a7f6381ba181f49857cc03 (diff)
parent805b2878d0b23d76917f5210abe35489f6f84c74 (diff)
downloadpuppet-284113707fa07c6abcbb765dcd6d8c24e1b6b5fa.tar.gz
puppet-284113707fa07c6abcbb765dcd6d8c24e1b6b5fa.tar.xz
puppet-284113707fa07c6abcbb765dcd6d8c24e1b6b5fa.zip
Merge branch '2.6.x' into 2.7.x
* 2.6.x: (#5318) Always notice changes to manifests when compiling. (#7681) Add an acceptance test for resource refs with array variables Conflicts (manually resolved): lib/puppet/parser/compiler.rb
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r--lib/puppet/parser/compiler.rb14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index 613fcae74..c1daade4c 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -15,15 +15,19 @@ class Puppet::Parser::Compiler
include Puppet::Resource::TypeCollectionHelper
def self.compile(node)
+ # We get these from the environment and only cache them in a thread
+ # variable for the duration of the compilation. If nothing else is using
+ # the thread, though, we can leave 'em hanging round with no ill effects,
+ # and this is safer than cleaning them at the end and assuming that will
+ # stick until the next entry to this function.
+ Thread.current[:known_resource_types] = nil
+ Thread.current[:env_module_directories] = nil
+
+ # ...and we actually do the compile now we have caching ready.
new(node).compile.to_resource
rescue => detail
puts detail.backtrace if Puppet[:trace]
raise Puppet::Error, "#{detail} on node #{node.name}"
- ensure
- # We get these from the environment and only cache them in a thread
- # variable for the duration of the compilation.
- Thread.current[:known_resource_types] = nil
- Thread.current[:env_module_directories] = nil
end
attr_reader :node, :facts, :collections, :catalog, :node_scope, :resources, :relationships