On Jan 24, 2011, at 9:59 AM, Stefan Schulte wrote:

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

As long as you're running 2.6, yes - a return code of 'nil' by 'sync' results 
in the event being autocreated.

As to querying, it's in the new reports, but that's about 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.

This is why the different event types exist, but we don't have any 
infrastructure in Puppet to support that, unfortunately.

-- 
The brain is a wonderful organ. It starts working the moment you get
up in the morning and does not stop until you get into the office.
            --Robert Frost
---------------------------------------------------------------------
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.

Reply via email to