On Feb 1, 2011, at 12:30 AM, Dan Bode wrote: > Hi all, > > I am trying to reduce a catalog down to only the resources with their > dependencies. > > I can get all resources in the catalog (including defined resource types, > classes, stages, and nodes) with the @catalog.resources method: > > I can get just the resources that will be applied with: > > @catalog.relationship_graph.topsort > > the problem is that the relationshipgraph view loses dependencies between: > defined resource types/stages/classes. > > Any pointers as to where in the code this is sorted out during apply? > Ideally, I could use this to figure out how to write a reduce method.
The 'splice' method on @catalog takes care of this - it essentially converts a graph with containment edges into a graph with dependency edges. If you just call 'relationship_graph' on your catalog, you'll get exactly this back. I haven't used it outside of the existing setup, so it might be a bit wonky, but it should work, based on what I think you want. -- I don't deserve this award, but I have arthritis and I don't deserve that either. -- Jack Benny --------------------------------------------------------------------- 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.
