Issue #18024 has been updated by Andrew Parker.
Status changed from Unreviewed to Rejected
I agree with Henrik. You can already write `scope['foo']` or `@foo` instead of
`scope.lookupvar('foo')`. For the example given of a fully qualified variable
name the `@foo` syntax is not available, but the `scope[]` syntax is.
I see no need for yet another alias for looking up a variable.
----------------------------------------
Feature #18024: Make a shorthand alias for scope.lookupvar()
https://projects.puppetlabs.com/issues/18024#change-87355
* 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.