diff options
author | James Turnbull <james@lovedthanlost.net> | 2008-02-14 09:29:55 +1100 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2008-02-14 09:29:55 +1100 |
commit | 0c457ee6373d436729a5d3492ca25a02c568103d (patch) | |
tree | c120078443ea368f94b5d51ad1dc1265234226cb /lib/puppet/parser/interpreter.rb | |
parent | 9f224f2327ca691f4263e36708ef4e7386b2c4b4 (diff) | |
parent | 0cfa1d2b7ae38020d3b845d7713cb10cda7facef (diff) | |
download | puppet-0c457ee6373d436729a5d3492ca25a02c568103d.tar.gz puppet-0c457ee6373d436729a5d3492ca25a02c568103d.tar.xz puppet-0c457ee6373d436729a5d3492ca25a02c568103d.zip |
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 1d93193dd..d4b7449fb 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -42,6 +42,26 @@ class Puppet::Parser::Interpreter @parsers = {} end + # Return the parser for a specific environment. + def parser(environment) + if ! @parsers[environment] or @parsers[environment].reparse? + # This will throw an exception if it does not succeed. We only + # want to get rid of the old parser if we successfully create a new + # one. + begin + tmp = create_parser(environment) + @parsers[environment].clear if @parsers[environment] + @parsers[environment] = tmp + rescue => detail + # If a parser already exists, than assume that we logged the + # exception elsewhere and reuse the parser. If one doesn't + # exist, then reraise. + raise detail unless @parsers[environment] + end + end + @parsers[environment] + end + private # Create a new parser object and pre-parse the configuration. @@ -67,24 +87,4 @@ class Puppet::Parser::Interpreter raise error end end - - # Return the parser for a specific environment. - def parser(environment) - if ! @parsers[environment] or @parsers[environment].reparse? - # This will throw an exception if it does not succeed. We only - # want to get rid of the old parser if we successfully create a new - # one. - begin - tmp = create_parser(environment) - @parsers[environment].clear if @parsers[environment] - @parsers[environment] = tmp - rescue => detail - # If a parser already exists, than assume that we logged the - # exception elsewhere and reuse the parser. If one doesn't - # exist, then reraise. - raise detail unless @parsers[environment] - end - end - @parsers[environment] - end end |