On 2015-21-09 22:34, Frédéric Lespez wrote:
In the 3.x function API use:
lookupvar('varname')
In the 4.x function API use:
closure_scope.lookupvar('varname')
Here is the specification for the 4.x API.
https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md
<https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2Fpuppetlabs%2Fpuppet-specifications%2Fblob%2Fmaster%2Flanguage%2Ffunc-api.md&sa=D&sntz=1&usg=AFQjCNE-GaBgyAfECLuUg52Idq1Erm6KtQ>
Thank Henrik. It works like a charm.
Also consider looking up the $facts hash instead of directly looking up
individual facts like $clientnoop. This to be future proof. (See the
link you posted regarding details).
In fact, using the $fact hash was my first choice. But I didn't find a
clientnoop fact, nor a noop fact.
Did I miss something ?
The docs are vague regarding $clientnoop - have to dig deeper to find
out what is going on wrt. that variable.
If you expected (as I did, but I did not really try things out) that it
is a fact and should have been in the $facts hash, then I suggest that a
ticket is logged. It is either a problem in code, or something that
should be mentioned in documentation.
- henrik
--
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 [email protected]
<mailto:[email protected]>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/557e90f2-d9e2-4d1b-a9c5-96dcf3f6bfd4%40googlegroups.com
<https://groups.google.com/d/msgid/puppet-users/557e90f2-d9e2-4d1b-a9c5-96dcf3f6bfd4%40googlegroups..com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.
--
Visit my Blog "Puppet on the Edge"
http://puppet-on-the-edge.blogspot.se/
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/mtrgeh%24e9o%241%40ger.gmane.org.
For more options, visit https://groups.google.com/d/optout.