Absolutely! Sorry I had missed the deprecation warning earlier.

Full agreement on all points.

Debugging away... :-)

On 12/01/2013 11:21 AM, David Portabella wrote:
> Hi,
> 
>> What works as expected:
>>> var from file.txt.erb: <%= var %>
> 
> using var instead of @var produces this warning on puppet 3:
> /Warning: Variable access via 'var' is deprecated. Use '@var' instead. /
> 
> and it's explained here: http://docs.puppetlabs.com/guides/templating.html
> /Historically, all of the variables visible in the current scope were
> also available as Ruby methods — that is, fqdn, memoryfree,
> operatingsystem, etc., without the prepended @ sign. This style of
> reference caused problems when variable names collided with Ruby method
> names; its use emits deprecation warnings as of Puppet 3 and will be
> removed in Puppet 4. Please update any existing code which uses it and
> start any new code out with the @fqdn instance-variable syntax.
> /
> 
>> var from file.txt.erb: <%= scope.lookupvar("var") %>
> yes, we need to use this function if we need to access
> someothermodule::var, or a hiera variable.
> however, using this function for all variables in the current scope
> would be ugly.
> 
> 
>> The fact that the member variable syntax @var works at all is confusing,
>> and may be considered a bug.
> 
> yes. that's what we are saying.
> 
> dynamic lookup in templates should show a warning in puppet 2.7, and
> stop working on puppet 3.
> 
> 
> Regards,
> David

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/529B0E5E.6090403%40Alumni.TU-Berlin.de.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to