>> I'm unsure how to do that in the clean app. Any hints how I could get >> the same autoload behavior as one has within the catalog to get it >> outside of any scope etc. working? > > Without going into the full context of what you're doing, the answer to your > final question is pretty straightforward. > > The whole compile process has a list of known resource types (which includes > nodes, classes, and definitions), available via Environment: > > Puppet::Node::Environment.new.known_resource_types.hostclasses > > Scopes just give you a search path for unqualified types/etc, which you won't > need in your case. So, you can just ask for the type directly. > > Note that each type (node, definition, hostclass) has multiple methods: > > hostclass(name) # finds an existing class > find_hostclass(name) # loads a class into memory if it's not there > hostclasses # return all known hostclasses. or maybe just names? > > There are similar methods for the other types. You can look through > lib/puppet/resource/type_collection.rb for the available methods (an instance > of this is what's available at Environment.new.known_resource_types.
Awesome, thanks! This is what I was looking for. :) New patch series will followup. I'll squash them together as nobody reviewed the others so far (I assume). I hope this is fine. ~pete -- 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.
