diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-27 10:12:54 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-05-27 10:12:54 -0700 |
commit | 805b2878d0b23d76917f5210abe35489f6f84c74 (patch) | |
tree | 058d094b259168623d214ea8b9d6648ddb976373 /lib/puppet/parser/compiler.rb | |
parent | 6a002894d3fb5fc59cae92fc4e4ae510e1e584e9 (diff) | |
parent | 75e2764d15de6cf1dee923019f579f436d5b1587 (diff) | |
download | puppet-805b2878d0b23d76917f5210abe35489f6f84c74.tar.gz puppet-805b2878d0b23d76917f5210abe35489f6f84c74.tar.xz puppet-805b2878d0b23d76917f5210abe35489f6f84c74.zip |
Merge branch 'bug/2.6.x/5318-minimal-fix' into 2.6.x
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 98bf3b574..2d065dad5 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 |