On Sun, Jan 23, 2011 at 09:01:52AM -0800, Luke Kanies wrote:
> On Jan 23, 2011, at 5:04 AM, Stefan Schulte wrote:
> 
> > When I look through the code a lot of properties define values which
> > return an event like »return :mount_created«. What is this event for?
> > 
> > The reason I want to know is the mount type. I made a few changes to
> > implement #4914 and when I sync from :absent to :mounted I have to
> >  1) create an fstab entry
> >  2) mount
> > 
> > Should I return :mount_mounted or :mount_created, or does it accept an 
> > array? Is this
> > even important?
> 
> In the end, it's something that I added a long time ago because I knew we'd 
> use it eventually, but we're only now getting to the point where it could be 
> useful.
> 
> However, at the same time Puppet is now much, much better at autodetermining 
> a reasonable event, so, basically, you should just entirely ignore it.
> 

Ok so just return nil and let puppet do it's magic? But I guess an event is
just any ruby symbol. In which situations can I query it?

Reason I'm asking:
Mount uses selfrefresh which is great because when the mountoptions are
changing we want to do a remount. But if puppet only changed the
mountstate itself from »unmounted« to »mounted« this will also call
refresh. On systems that do not support remount this must look really
silly when puppet mounts the resource, which will call refresh that
will now unmount the resource just to mount it a second time again.

It would be creat to have all events that triggered the refresh as an
array in the refresh method. I could then check if :mount_mounted was the
only event and I could just do nothing.

-Stefan

Attachment: pgpBc7uvxfaQq.pgp
Description: PGP signature

Reply via email to