On Mon, Mar 7, 2011 at 14:14, Trevor Vaughan <tvaug...@onyxpoint.com> wrote:

> I *think* I get what you're saying, but how would you translate this
> to something that needs to see if an entry in a file is synchronized?

So, let me be clear: *if* you can avoid replacing sync, that would be
good.  If you can't, and it is possible that you can't, then you might
get stuck with it.

However, the ideal situation is:
1. Load stuff into memory in the 'prefetch' method.
2. Update the in-memory representation of your data in the provider
'value=' method, for each value.
3. Write out / update the file in the provider 'flush' method, which
is called when all the value methods have been called.

> Yes, I know that I could possibly use parsed file, but it didn't work
> out of the box the way I needed and it was faster to start from
> scratch than try to override parsed file correctly.

I hope that points you in the right direction.  If that model doesn't
work for you, replacing sync might be viable, but it is likely to be a
lot more work in the longer term.

[…]
> I see a lot of people noting how "easy" it is, but most that I see
> aren't deviating too far from the norm and I don't see a lot of
> explanation as to "why" you're doing what you're doing.

If it helps, I think their claims are … well, not wrong, as such, but
it really isn't that easy until you know how. :)

Daniel
-- 
⎋ Puppet Labs Developer – http://puppetlabs.com
✉ Daniel Pittman <dan...@puppetlabs.com>
✆ Contact me via gtalk, email, or phone: +1 (877) 575-9775
♲ Made with 100 percent post-consumer electrons

-- 
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.

Reply via email to