On Mar 26, 2010, at 9:48 AM, Brice Figureau wrote:

On Fri, 2010-03-26 at 09:30 -0700, Markus Roberts wrote:
brice:tickets/0.25.x/3396 (Faster event propagation) succeeded:
   * 7c3cd8c Fix inefficient SimpleGraph#matching_edge
   7771 examples, 28 failures, 41 pending
       4 more in unit/simple_graph.rb (4 total)


       This is not good. Looks like we are missing Luke's glue event
       patch, or
       there is something at play here.

The event-->events patch appears to be there; the problem appears to
be with the event.source patch (all of the errors look like this):

That's what I was thinking.

But I also remember Luke saying:
On Mar 21, 2010, at 9:50 AM, Brice Figureau wrote:
I explored Lak's repositories and found that event.source was
renamed
into event.resource (apparently).

Something like that - it looks like that should work for the
purposes
of this, although I'd definitely test it.  I think for most cases
both
the resource and property will be set (to strings), but I think
there
are some cases where just the source_description is set.  For some
reason I've made 'log_source' a private method; this would probably
actually be the best thing to use, since it picks the best value.

So, I'm puzzled: we lost event.source, and got event.resource instead
that is a string (ie a resource ref and not an resource instance
anymore), so clearly my patch can't work directly (it needs resource
instances).

What's the reason behind the change from source to resource ref for
events?
I think I'll have to analyze this. I'll try to post a refined (for
master only) #3396 patch during the week-end.


There were two important changes that led to this:

1) I previously had a 'source=' method that had a lot of complicated logic that attempted to differentiate between resources as sources vs. non-resources, and I was able to essentially remove all of that logic by changing some assumptions.

2) I wanted to store whether an event was coming from a property, but also the resource, and yet still have a general 'source' concept when none were true.

I think the right answer is to add back a 'source' method that picks the right string. There's actually already that private method, log_source or something similar; it could just be renamed and made public.

Really, though, I don't think that's your problem - aren't the errors something about inject being an unknown method on Event? Seems like someone's expecting an array and not getting one.


--
Real freedom lies in wildness, not in civilization.
    -- Charles Lindbergh
---------------------------------------------------------------------
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