On Dec 13, 2010, at 2:00 PM, Dan Bode wrote:

> Hi all,
> 
> I was trying to figure out how to include parametrized classes. I eventually 
> got it to work with the following syntax, but I don't understand what it does 
> (I tried to read the code). Can someone explain the magic of 
> known_resource_types?
> 
> classes.each do |name, params|
>         klass = Puppet::Resource::Type.new(:hostclass, name, params)
>         known_resource_types.add klass
> end

Is this from a function, or what?  There's clearly context missing here (e.g., 
where do 'params' come from? how is 'classes' created?)

This shouldn't actually cause class evaluation during parsing - it just creates 
the class, it doesn't say anything about evaluating it.  At least, from what I 
understand.

-- 
A government big enough to give you everything you want is big enough
to take from you everything you have.           --Gerald R. Ford
---------------------------------------------------------------------
Luke Kanies  -|-   http://puppetlabs.com   -|-   +1(615)594-8199



-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to