Issue #21373 has been updated by Henrik Lindberg.

This was caused by the AST transformer that passed on the parent as an AST 
object for all kinds of parent expressions.
Apparently, the 3x AST::Node relays this to Resource::Type which only handles 
the AST::Regexp - all other values were expected to be resolved to String 
already.

This caused to_s to be called on the AST::ASTString which resulted in the node 
name "base" but as an AST object, not a string. The error message is confusing, 
because  it is output as if it was a regular string.


----------------------------------------
Bug #21373: parser = future: node inheritence is broken
https://projects.puppetlabs.com/issues/21373#change-97437

* Author: Brice Figureau
* Status: Accepted
* Priority: Normal
* Assignee: Henrik Lindberg
* Category: parser
* Target version: 
* Affected Puppet version: 3.2.1
* Keywords: future_parser
* Branch: 
----------------------------------------
While testing my set of manifests with the new parser, I found the following 
error:
<pre>
Error: Could not find parent resource type '"base"' of type node in production 
at /Users/brice/cvs/puppet/manifests/site.pp:962 on node server8.domain.com
</pre>

This was when using the master static compiler.
Doing a binary bisection, here's the smallest manifests (site.pp) that triggers 
the issue:
<pre>
# site.pp

node "base" {
  notice("base")
}

node "pouet" inherits "base" {
  notice("pouet")
}
</pre>

This can be reproduced with this apply command-line and the abose manifests
<pre>
puppet apply --parser future --verbose --trace --confdir /tmp/master --vardir 
/tmp/master --user brice --group brice --manifestdir ../../manifests 
/tmp/site.pp
</pre>

The error is the following:
<pre>
Error: Could not find parent resource type '"base"' of type node in production 
at /tmp/site.pp:5 on node macbook-3.local
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/errors.rb:96:in
 `fail'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/resource/type.rb:286:in
 `parent_type'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/resource/type.rb:234:in
 `instantiate_resource'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/resource/type.rb:226:in
 `ensure_in_catalog'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/parser/compiler.rb:218:in
 `evaluate_ast_node'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/parser/compiler.rb:99:in
 `compile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/profiler/none.rb:6:in
 `profile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/profiler.rb:26:in
 `profile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/parser/compiler.rb:99:in
 `compile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/parser/compiler.rb:29:in
 `compile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/indirector/catalog/compiler.rb:86:in
 `compile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/profiler/none.rb:6:in
 `profile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/profiler.rb:26:in
 `profile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/indirector/catalog/compiler.rb:84:in
 `compile'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/indirector/catalog/compiler.rb:44:in
 `find'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/indirector/indirection.rb:197:in
 `find'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application/apply.rb:209:in
 `main'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application/apply.rb:151:in
 `run_command'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application.rb:364:in
 `run'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application.rb:456:in
 `plugin_hook'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application.rb:364:in
 `run'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util.rb:504:in
 `exit_on_fail'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/application.rb:364:in
 `run'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/command_line.rb:132:in
 `run'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/lib/puppet/util/command_line.rb:86:in
 `execute'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/gems/puppet-3.2.1/bin/puppet:4
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/bin/puppet:19:in `load'
/Users/brice/.rvm/gems/ruby-1.8.7-p334@manifests/bin/puppet:19
</pre>

Of course all this is working with the old parser.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-bugs+unsubscr...@googlegroups.com.
To post to this group, send email to puppet-bugs@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-bugs.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to