On Thu, 2008-10-16 at 14:32 -0500, Luke Kanies wrote: > On Oct 16, 2008, at 12:54 PM, Brice Figureau wrote: > > > > > Hi, > > > > I just discovered that the fix for #1202 (and particularly the fact > > that > > I added a tags method to TemplateWrapper) broke the following test: > > should return the processed template contents with a call to result > > and > > should set all of the scope's variables as instance variables > > > > I didn't perform a thorough analysis, but it is beacause > > TemplateWrapper > > is used as a log source. Log sources are asked for their tags by > > calling > > the tags method. In the case of TemplateWrapper it is plain wrong to > > do so. > > Why is that? If you're logging from there, wouldn't you want to > include the tags in the log message?
I want to list the tags in the log message. But it will lists _all_ the tags of the catalog, not the tags of the current context (ie the resource tags) where the template is used. When I wrote the patch, I took the original contribution and just added some tests above. Maybe the intent of the ticket was not to provide an access to the catalog tags but to only the current resource tags (ie scope.tags instead of scope.catalog.tags), or maybe both? What do you think would be the best? > The TemplateWrapper class needs to be slightly refactored to use > Puppet::Util::Logging, instead of the Puppet::Util.logmethods, but > otherwise, it seems right. (You'd get the same behaviour, just > cleaner code.) > > > > > I'm seeing two options: > > * fix the test themselves (I don't think that's the right > > solution :-)) > > or > > * rename TemplateWrapper.tags to TemplateWrapper.get_tags or sth > > else. > > > > Any other idea? > > Let me know and I'll contribute a fix patch. > > I'd fix the tests, because I think the behaviour's right. What makes > you disagree? See above. -- Brice Figureau <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
