bobics
2011-Jan-12 22:11 UTC
[Puppet Users] error when require is used within a parameterized class
I have the following use case, which I think is a very valid use case, but puppet is throwing an error. Puppet''s implementation of how parameterized classes work with include/require breaks the *declarative* nature of Puppet. I believe this is the same bug as: http://projects.puppetlabs.com/issues/5046 It seems there is a lot of discussion in that ticket, and IMO this use case should be supported. # this works fine node default { class { ruby: version => "1.8" } class { rails: version => "3.0" } } # this throws an error "Must pass version to Class[Ruby] at ... site.pp:13" node baderror { class { rails: version => "3.0" } class { ruby: version => "1.8" } } class ruby ($version) { # line 13 } class rails ($version) { require ruby } The reason I ran into this bug now is because I''m also using class inheritance (for simplicity, I have not shown this in my example above). -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.
bobics
2011-Jan-12 22:35 UTC
[Puppet Users] Re: error when require is used within a parameterized class
I forgot to mention, the other annoying issue is that the error message points to the file and line number of the parameterized class declaration, NOT the require statement. Enabling verbose/debug output doesn''t help in finding the offending require statement. I basically had to figure out for myself where the error was. On Jan 12, 2:11 pm, bobics <bob...@gmail.com> wrote:> I have the following use case, which I think is a very valid use case, > but puppet is throwing an error. Puppet''s implementation of how > parameterized classes work with include/require breaks the > *declarative* nature of Puppet. I believe this is the same bug as: > > http://projects.puppetlabs.com/issues/5046 > > It seems there is a lot of discussion in that ticket, and IMO this use > case should be supported. > > # this works fine > node default { > class { ruby: version => "1.8" } > class { rails: version => "3.0" } > > } > > # this throws an error "Must pass version to Class[Ruby] at ... > site.pp:13" > node baderror { > class { rails: version => "3.0" } > class { ruby: version => "1.8" } > > } > > class ruby ($version) { # line 13 > > } > > class rails ($version) { > require ruby > > } > > The reason I ran into this bug now is because I''m also using class > inheritance (for simplicity, I have not shown this in my example > above).-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.
Daniel Pittman
2011-Jan-13 05:02 UTC
Re: [Puppet Users] Re: error when require is used within a parameterized class
Hey there. Thanks for this detailed problem report, and especially for the manifest that reproduces the problem. I will make sure we generate a test case for this tomorrow so that we don''t lose track of it. I can''t promise a specific timeframe for fixing it, but that test will make sure that does happen, and that we don''t regress on this case afterwards. Thanks for your patience, Daniel On Wed, Jan 12, 2011 at 14:35, bobics <bobics@gmail.com> wrote:> I forgot to mention, the other annoying issue is that the error > message points to the file and line number of the parameterized class > declaration, NOT the require statement. Enabling verbose/debug output > doesn''t help in finding the offending require statement. I basically > had to figure out for myself where the error was. > > On Jan 12, 2:11 pm, bobics <bob...@gmail.com> wrote: >> I have the following use case, which I think is a very valid use case, >> but puppet is throwing an error. Puppet''s implementation of how >> parameterized classes work with include/require breaks the >> *declarative* nature of Puppet. I believe this is the same bug as: >> >> http://projects.puppetlabs.com/issues/5046 >> >> It seems there is a lot of discussion in that ticket, and IMO this use >> case should be supported. >> >> # this works fine >> node default { >> class { ruby: version => "1.8" } >> class { rails: version => "3.0" } >> >> } >> >> # this throws an error "Must pass version to Class[Ruby] at ... >> site.pp:13" >> node baderror { >> class { rails: version => "3.0" } >> class { ruby: version => "1.8" } >> >> } >> >> class ruby ($version) { # line 13 >> >> } >> >> class rails ($version) { >> require ruby >> >> } >> >> The reason I ran into this bug now is because I''m also using class >> inheritance (for simplicity, I have not shown this in my example >> above). > > -- > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > 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. > >-- ✉ Daniel Pittman <daniel@rimspace.net> ⌨ daniel@rimspace.net (XMPP) ☎ +1 503 893 2285 ♻ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.