summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/interpreter.rb12
-rw-r--r--lib/puppet/parser/scope.rb7
2 files changed, 14 insertions, 5 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb
index 35c122c43..5f5ecbe1f 100644
--- a/lib/puppet/parser/interpreter.rb
+++ b/lib/puppet/parser/interpreter.rb
@@ -10,6 +10,8 @@ require 'puppet/parser/scope'
module Puppet
module Parser
class Interpreter
+ include Puppet::Util
+
Puppet.setdefaults("ldap",
:ldapnodes => [false,
"Whether to search for node configurations in LDAP."],
@@ -107,7 +109,7 @@ module Puppet
end
if nodeclasses
- Puppet.info "Found %s in %s" % [client, source]
+ Puppet.info "Found %s in %s" % [node, source]
return parent, nodeclasses
end
end
@@ -206,12 +208,11 @@ module Puppet
"Cannot evaluate nodes with a nil client"
end
- Puppet.debug "Nodes defined"
args[:names] = names
parent, nodeclasses = nodesearch(client)
- classes += nodeclasses if nodeclasses
+ args[:classes] += nodeclasses if nodeclasses
args[:parentnode] = parent if parent
end
@@ -290,7 +291,10 @@ module Puppet
else
@parser.file = @file
end
- @ast = @parser.parse
+
+ @ast = benchmark(:info, "Parsed manifest") do
+ @parser.parse
+ end
# Mark when we parsed, so we can check freshness
@parsedate = Time.now.to_i
diff --git a/lib/puppet/parser/scope.rb b/lib/puppet/parser/scope.rb
index 35137fda7..27de8ffd8 100644
--- a/lib/puppet/parser/scope.rb
+++ b/lib/puppet/parser/scope.rb
@@ -297,13 +297,18 @@ module Puppet::Parser
raise Puppet::DevError, "Node names must be provided to gennode"
facts = hash[:facts]
classes = hash[:classes]
- parent = hash[:parent]
+ parent = hash[:parentnode]
name = names.shift
arghash = {
:type => name,
:code => AST::ASTArray.new(:pin => "[]")
}
+ #Puppet.notice "hash is %s" %
+ # hash.inspect
+ Puppet.notice "Classes are %s, parent is %s" %
+ [classes.inspect, parent.inspect]
+
if parent
arghash[:parentclass] = parent
end