Re: [Puppet Users] Puppet 3.0 rspec and custom resources

Jeff McCune
Fri, 26 Oct 2012 22:33:59 -0000

Hrmmm.

Is there a small rspec example you could post that reproduces this
issue?  I''d love to try and reproduce it since there''s
definitely a
possibility that a change between Puppet 2.7 and 3.0 is responsible
for this issue.

-Jeff

On Fri, Oct 26, 2012 at 8:01 AM, Nathan Huff <nathan.ri.huff@gmail.com>
wrote:
> I am trying to figure out if I am missing something simple here.  After
> upgrading to puppet 3.0 running puppet-rspec tests that use
> custom resources from modules in the fixtures directory are failing.  I
have
> a module that uses the anchor type and with 2.7.19 it works fine.
> After upgrading to 3.0 all of the tests are failing with
>
> Puppet::Error:
>        Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type anchor at
> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2
on
> node enyo.localhost
>
> The debug output is
> Debug: importing
>
''/home/nrhuff/repos/puppet-os/spec/fixtures/manifests/site.pp''
in
> environment production
> Debug: importing
>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/init.pp''
> in environment production
> Debug: Automatically imported stdlib from stdlib into production
> Debug: importing
>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/stdlib/manifests/stages.pp''
> in environment production
> Debug: Automatically imported stdlib::stages from stdlib/stages into
> production
> Debug: importing
>
''/home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp''
in
> environment production
> Debug: Automatically imported os from os into production
> Error: Puppet::Parser::AST::Resource failed with error ArgumentError:
> Invalid resource type anchor at
> /home/nrhuff/repos/puppet-os/spec/fixtures/modules/os/manifests/init.pp:2
on
> node enyo.localhost
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource.rb:218:in
> `initialize''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:120:in
> `initialize''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
> `new''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:44:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util/errors.rb:35:in
> `exceptwrap''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:43:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
> `collect''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:42:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/module.rb:283:in
> `collect''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:16:in
> `each''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/branch.rb:15:in
> `each''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
> `collect''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/resource.rb:25:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
> `safeevaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
> `each''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
> `safeevaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource/type.rb:136:in
> `evaluate_code''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:81:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb
> :165:in `evaluate_classes''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:150:in
> `each''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:150:in
> `evaluate_classes''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions/include.rb:11:in
> `real_function_include''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions.rb:63:in
> `send''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/functions.rb:63:in
> `function_include''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/function.rb:31:in
> `send''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/function.rb:31:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
> `safeevaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:25:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
> `each''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast/astarray.rb:20:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/ast.rb:62:in
> `safeevaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/resource/type.rb:136:in
> `evaluate_code''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/resource.rb:81:in
> `evaluate''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:282:in
> `evaluate_main''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:96:in
> `compile_unadorned''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-hiera-puppet-1.0.0/lib/rspec-hiera-puppet/puppet.rb:16:in
> `compile''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/parser/compiler.rb:29:in
> `compile''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:77:in
> `compile''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/util.rb:184:in
> `benchmark''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:75:in
> `compile''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/catalog/compiler.rb:35:in
> `find''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/puppet-3.0.1/lib/puppet/indirector/indirection.rb:191:in
> `find''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/support.rb:18:in
> `build_catalog_without_cache''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/support.rb:24:in
> `build_catalog''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example/class_example_group.rb:55:in
> `catalogue''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-puppet-0.1.5/lib/rspec-puppet/example/class_example_group.rb:7:in
> `subject''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/subject.rb:64:in
> `should''
> /home/nrhuff/repos/puppet-os/spec/classes/os_spec.rb:14
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in
> `instance_eval''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:113:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:253:in
> `with_around_each_hooks''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example.rb:110:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:378:in
> `run_examples''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in
> `map''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:374:in
> `run_examples''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:360:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
> `map''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/example_group.rb:361:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
> `map''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:28:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/reporter.rb:34:in
> `report''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:25:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in
> `run''
>
/home/nrhuff/.rvm/gems/ruby-1.8.7-p358/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in
> `autorun''
> /home/nrhuff/.rvm/gems/ruby-1.8.7-p358/bin/rspec:19
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/puppet-users/-/CwP92gjyuusJ.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.