On 10/15/2012 07:23 PM, Stefan Schulte wrote:
Another speed improvement is to implement an `instances` and `prefetch`
method. That has the benefit that puppet does "react" on such methods
if they are implemented:
* you are able to run "puppet resource cobblersystem" on the command
line to get the current configuration of all systems (that depends on
an instances classmethod)
* you can use the resources type to purge unmanaged systems
resources { 'cobblersystem':
purge => true
}
* the prefetch method is automatically called by puppet if implemented
to create provider instances
* your get methods become trivial
Thank both you and Nan Liu.
As the holidays approached I finally got a free day to work on this :)
I've rewritten 3 out of 4 my custom providers to self.instances schema.
I will test this and report back performance improvements on puppet
agents run with lots of resources of custom type I wrote, after I
rewrite the final provider.
And code looks much cleaner too! :) Once more a big thank you both :)
--
Jakov Sosic
www.srce.unizg.hr
--
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+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.