Issue #18024 has been updated by Peter Meier.

Peter Meier wrote:
> It looks like this way to access the scope is not documented in your official 
> documentation. http://docs.puppetlabs.com/guides/templating.html Would be 
> good to fix it there!

Bug report for that #19841

----------------------------------------
Feature #18024: Make a shorthand alias for scope.lookupvar()
https://projects.puppetlabs.com/issues/18024#change-87370

* Author: Yuri Arabadji
* Status: Rejected
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: https://github.com/puppetlabs/puppet/pull/1538
----------------------------------------
Tired of writing scope.lookupvar() in my templates. Gepetto doesn't have 
working auto-completion, sadly, so I have to ask here for a solution. 
That function is the most used in templates, assuming you've got hierarchy of 
defines/classes and there's an "intermediary" class between the defined 
resource and template. 
<pre>
class a {
  $thevar = 123
  whatever { 'yy': tmpl => 'xx'}
}

define whatever($tmpl) {
  file { /xxx:
   content => template($tmpl)
  }
}

xx.erb:

<%= scope.lookupvar('a::thevar') %>
</pre>

Maybe you could make a short alias for it, for ex.: "sl" or "slv".

Thanks.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to