On 26/01/09 20:38, Luke Kanies wrote:
> On Jan 26, 2009, at 9:08 AM, Brice Figureau wrote:
> 
>> On Mon, 2009-01-26 at 08:48 -0600, Luke Kanies wrote:
>>> [...]
>>> I've been going through the system and making sure everyone uses the
>>> Tagging module, although I think there are still a few stragglers out
>>> there who don't.
>>>
>>> You *should* be able to just modify that module to convert all tags  
>>> to
>>> strings; I've looked quickly through the code, and it looks like none
>>> of the parsing code still has its own 'tag' method.
>> Yes, I think.
>> But the original issue remains, this is not tags but resource
>> parameters. In particular this is the title of the class "main", or
>> maybe I'm misunderstanding what you're saying.
> 
> I agree, the original issue is there; I was just pointing out that  
> snippet of code that didn't want to assume a tag was a string.  It  
> should be able to assume that, as you should be able to guarantee it's  
> a string during the setting of the tag.

OK, just to be sure; you want me to add a Symbol check in 
Puppet::Util::Tagging.tag and convert to string if needed, is that right?

That still doesn't solve my current issue which is that the title of the 
main class is a symbol and not a string (and it seems to be done on 
purpose, as there lots of checks for title == :main in the code):

>From compiler.rb:
@main_resource = Puppet::Parser::Resource.new(:type => "class", :title 
=> :main, :scope => @topscope, :source => @main)

I won't change this, hence I have to fiddle with this on the rails side 
as I did, because I simply don't have a guarantee that any resource 
parameter could never be a symbol.

The root issue is that to know if a resource is new, old or perhaps 
modified, we judge from their reference string. For the resource coming 
from the catalog that's Class[main], but for what is loaded from the 
database it was Class[--- :main\n] (ie YAML for :main as title).
Maybe the only issue is to let rails serialize the symbol as it was done 
before, but to make sure the constructed reference unserialize it as it 
should?
I'm seeking advice about this...

>> OK, then I'll keep working on it this week. I'll take into account  
>> your
>> comments and see if it survives my (small) production load.
> 
> Great.

I've remodeled the patch per your comments, I'll do the load test tomorrow.

Do you prefer patch against master nowadays?

Thanks,
-- 
Brice Figureau
Days of Wonder
http://www.daysofwonder.com

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