On 2015-18-05 20:54, Alessandro Franceschi wrote:
> Thank you for the useful info, going to dive into this, looks quite
> powerful
>
I suppose you found the specification of the API:
https://github.com/puppetlabs/puppet-specifications/blob/master/language/func-api.md
Regards
- henrik
> On Thursday, May 14, 2015 at 1:51:49 PM UTC+2, henrik lindberg wrote:
>
> On 2015-14-05 12:58, Alessandro Franceschi wrote:
> > Hi all,
> > sorry to bother, I should probably search around better but I'm
> quite
> > confident that I can find here a quick solution.
> >
> > I've this issue:
https://github..com/example42/puppi/issues/123
> <
https://github.com/example42/puppi/issues/123> in a
> > function which tries to use the hiera function as follows:
> >
> > value = function_hiera(["#{module_name}_#{var_name}", ''])
> >
> >
> > The error message comes from the 3.x API hiera class in
> > lib/parser/functions/
> >
> > |Error: Evaluation Error: Error while evaluating a Function Call,
> hiera() has been converted to 4x API|
> >
> >
> > Wha's the syntax to use an API4 function inside a function?
> > Maybe should I move the function in my module from
> > lib/puppet/parser/functions to lib/puppet/functions and edit
> something?
>
> If you change your function to use the 4.x API then it can call any
> function (3.x or 4.x) using the method call_function. This works from
> 3.7.5 (earlier version had a problem in calling a 3.x function from 4.x
> - see
https://tickets.puppetlabs.com/browse/PUP-3548
> <
https://tickets.puppetlabs.com/browse/PUP-3548>).
> > an email to
puppet-dev+...@googlegroups.com <javascript:>
> > <mailto:
puppet-dev+...@googlegroups.com <javascript:>>.
> <
https://groups.google.com/d/msgid/puppet-dev/d6e542ff-854f-4b46-a568-96f418586af5%40googlegroups.com?utm_medium=email&utm_source=footer
> <
https://groups.google.com/d/optout>.
> <
http://puppet-on-the-edge.blogspot.se/>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
puppet-dev+...@googlegroups.com
> <mailto:
puppet-dev+...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/puppet-dev/e5c6cfed-7a1e-40cd-9fc0-d711ffe559cd%40googlegroups.com
> <
https://groups.google.com/d/msgid/puppet-dev/e5c6cfed-7a1e-40cd-9fc0-d711ffe559cd%40googlegroups.com?utm_medium=email&utm_source=footer>.