On Nov 21, 2008, at 11:35 AM, Nigel Kersten wrote:
>
> On Fri, Nov 21, 2008 at 9:19 AM, Luke Kanies <[EMAIL PROTECTED]> wrote:
>>
>>
>>
>> I agree there's something ridiculous going on here, but you shouldn't
>> need to manually munge things.
>>
>> I'd start by adding debugging to your type to see where you've got  
>> the
>> boolean and where you've got the symbol or whatever.
>
> so my "shared" method in the provider returns a TrueClass.
>
> my "shared=(value)" method is getting a Symbol.
>
> I can work around this, but it isn't what I expected to happen.

Yeah, this is the ridiculous part -- you shouldn't need to use a  
symbol here, but you do at this point, I think.

>> From the code, only strings are converted to symbols by default, but
>> I think a limitation in the system caused me to start using symbols
>> everywhere, and there's some kind of magic that that makes true/false
>> work.
>>
>> For this, you might also try adding ':boolean => true' to the  
>> property
>> declaration:
>>
>>  newproperty(:shared, :boolean => true) do ... end
>>
>> This should actually be autodetected, but it's convenient in that it
>> gives you a 'resource.shared?' method, which can be useful.
>
> This works nicely actually, apart from not getting automatic value
> validation the same way newvalue(:true) newvalue(:false) does. That
> should probably be automatic shouldn't it?

Heh, sorry -- you still need to add the newvalue calls there, and  
you're right that you shouldn't need to.

>
> If I leave the newvalues out, and have a manifest like:
>
> macauthorization {"system.device.dvd.setregion.initial":
>  ensure => present,
>  shared => false,
> }
>
> I get this:
>
> err: //Macauthorization[system.device.dvd.setregion.initial]/shared:
> change from true to false failed: Got a nil value for should
>
> hmm. I'll clean up the code a bit and stick it up somewhere to make
> this conversation a bit more productive.

Ok.


-- 
I don't know the key to success, but the key to failure is trying to
please everybody. -- Bill Cosby
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to