Hi Nikolay, On Fri, Feb 18, 2011 at 9:34 AM, Nikolay Sturm <goo...@erisiandiscord.de>wrote:
> Hi, > > in order to extend cucumber-puppet to support parameterised classes, I > need to create a node object from a parameterised class. > > At the moment my code does sth like this: > > node = Puppet::Node.new(@facts['hostname'], :classes => @klass) > node.merge(@facts) > @catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node) > This is fixed by my patch for param class support for ENC: http://projects.puppetlabs.com/issues/5045 This will only work against 2.6.5 (currently at rc4) The only difference is that :classes should take a hash instead of an array. require 'puppet' => true irb(main):002:0> node = Puppet::Node.new('nodename', :classes => {'ntp' => {'servers' => ['foo'] }}) => #<Puppet::Node:0xb7841838 @parameters={}, @time=Sun Feb 13 11:49:25 -0600 2011, @name="nodename", @classes={"ntp"=>{"servers"=>["foo"]}}> irb(main):003:0> node.merge({}) => "production" irb(main):004:0> Puppet::Resource::Catalog.find(node.name, :use_node => node) > Where and how would I have to add the class's parameters? > > cheers, > > Nikolay > > -- > "It's all part of my Can't-Do approach to life." Wally > > -- > You received this message because you are subscribed to the Google Groups > "Puppet Developers" group. > To post to this group, send email to puppet-dev@googlegroups.com. > To unsubscribe from this group, send email to > puppet-dev+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Puppet Developers" group. To post to this group, send email to puppet-dev@googlegroups.com. To unsubscribe from this group, send email to puppet-dev+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.