summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2008-02-29 12:49:06 +1100
committerJames Turnbull <james@lovedthanlost.net>2008-02-29 12:49:06 +1100
commitf1d75c8bc2604ea396c6d88ba7eef866f48f6046 (patch)
treeb534a6011dd4074a61ff76962b855bb404faa310 /lib/puppet/parser
parent62865e0dc921b3d81a89d59c387c3697f37a629c (diff)
parent43aea83eb1ac388566246e5418394e31a4cad697 (diff)
downloadpuppet-f1d75c8bc2604ea396c6d88ba7eef866f48f6046.tar.gz
puppet-f1d75c8bc2604ea396c6d88ba7eef866f48f6046.tar.xz
puppet-f1d75c8bc2604ea396c6d88ba7eef866f48f6046.zip
Merge branch '0.24.x' of git://reductivelabs.com/puppet into 0.24.x
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/astarray.rb24
-rw-r--r--lib/puppet/parser/compiler.rb5
-rw-r--r--lib/puppet/parser/interpreter.rb6
3 files changed, 10 insertions, 25 deletions
diff --git a/lib/puppet/parser/ast/astarray.rb b/lib/puppet/parser/ast/astarray.rb
index b66fd6bba..8f09aa922 100644
--- a/lib/puppet/parser/ast/astarray.rb
+++ b/lib/puppet/parser/ast/astarray.rb
@@ -16,16 +16,6 @@ class Puppet::Parser::AST
# Evaluate our children.
def evaluate(scope)
- rets = nil
- # We basically always operate declaratively, and when we
- # do we need to evaluate the settor-like statements first. This
- # is basically variable and type-default declarations.
- # This is such a stupid hack. I've no real idea how to make a
- # "real" declarative language, so I hack it so it looks like
- # one, yay.
- settors = []
- others = []
-
# Make a new array, so we don't have to deal with the details of
# flattening and such
items = []
@@ -34,22 +24,14 @@ class Puppet::Parser::AST
@children.each { |child|
if child.instance_of?(AST::ASTArray)
child.each do |ac|
- if ac.class.settor?
- settors << ac
- else
- others << ac
- end
+ items << ac
end
else
- if child.class.settor?
- settors << child
- else
- others << child
- end
+ items << child
end
}
- rets = [settors, others].flatten.collect { |child|
+ rets = items.flatten.collect { |child|
child.safeevaluate(scope)
}
return rets.reject { |o| o.nil? }
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index 132ec15db..70cd6e11a 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -366,9 +366,8 @@ class Puppet::Parser::Compiler
# Make sure all of our resources and such have done any last work
# necessary.
def finish
- @catalog.resources.each do |name|
- resource = @catalog.resource(name)
-
+ #@catalog.resources.each do |name|
+ @catalog.vertices.each do |resource|
# Add in any resource overrides.
if overrides = resource_overrides(resource)
overrides.each do |over|
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index d4655c403..f27c1c5c8 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -61,7 +61,11 @@ class Puppet::Parser::Interpreter
# 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]
+ if @parsers[environment]
+ Puppet.err detail
+ else
+ raise detail
+ end
end
end
@parsers[environment]