Luke Kanies <[EMAIL PROTECTED]> writes:
> On Jul 20, 2008, at 3:59 AM, Daniel Pittman wrote:
>> Luke Kanies <[EMAIL PROTECTED]> writes:
>>> Why don't you try the recursive setting of instance variables and see
>>> how it performs? It might be sufficient.
>>
>> So, as expected this had the side-effect of making it impossible to
>> detect when an undefined variable was used in a template. This was
>> quite a loss, in my opinion, and something I would rather not give up.
>
> Why would that be the case? Ruby has a builtin 'defined?' method:
Ah, my explanation was unclear:
...this had the side-effect of making it impossible for Puppet to
automatically detect, and signal an error, when the template used an
undefined variable.
At the moment a reference to an undefined value will raise an exception,
failing the catalog build.
Using an undefined variable, after the change, will simply return
'nil'. That gives up this (IMO, desirable) behaviour of treating an
undefined value as an error.
So, yes, the author could manually test every value was defined, but a
typographic error in the template would go unnoticed.[1]
What would be list is *automatic* checking.
Regards,
Daniel
Footnotes:
[1] I would be disappointed by this, because on a couple of occasions
this has detected my mis-typing in templates that were otherwise
correct, and ensured that I did not push out an invalid
configuration file to my hosts.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---