diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 19:16:10 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-19 19:16:10 +0000 |
commit | 9b5833a63cc88fff7ce8e157e6ab079d3fd3f631 (patch) | |
tree | f367096862d5f24cd55bcb0b88e4a2efd41682dc /lib/puppet/parser/interpreter.rb | |
parent | 1f8b768e4ebef4e9ee54ee96db2544d6f9522bbf (diff) | |
download | puppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.tar.gz puppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.tar.xz puppet-9b5833a63cc88fff7ce8e157e6ab079d3fd3f631.zip |
Clarifying the errors a bit when nodes come from external sources.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2324 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser/interpreter.rb')
-rw-r--r-- | lib/puppet/parser/interpreter.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/puppet/parser/interpreter.rb b/lib/puppet/parser/interpreter.rb index 5eb44c39c..936bc31eb 100644 --- a/lib/puppet/parser/interpreter.rb +++ b/lib/puppet/parser/interpreter.rb @@ -314,7 +314,7 @@ class Puppet::Parser::Interpreter end # Create a new node, just from a list of names, classes, and an optional parent. - def gennode(name, hash) + def gennode(name, hash, source = nil) facts = hash[:facts] classes = hash[:classes] parent = hash[:parentnode] @@ -348,7 +348,14 @@ class Puppet::Parser::Interpreter end # Create the node - return @parser.ast(AST::Node, arghash) + if source + arghash[:file] = source + else + arghash[:file] = nil + end + arghash[:line] = nil + node = @parser.ast(AST::Node, arghash) + return node end # create our interpreter @@ -716,7 +723,7 @@ class Puppet::Parser::Interpreter Puppet.warning "Somehow got a node with no information" return nil else - return gennode(name, args) + return gennode(name, args, Puppet[:external_nodes]) end end @@ -727,7 +734,7 @@ class Puppet::Parser::Interpreter args = {} args[:classes] = classes if classes args[:parentnode] = parent if parent - return gennode(node, args) + return gennode(node, args, "ldap") else return nil end |