FAQ
This is on Windows running 2.7.16. I haven't tested on Linux or other
versions. I'm still relatively new to Puppet and haven't used custom
functions before, so wanted to run this by the list before filing a bug.

When calling custom functions from functions, arguments are being converted
to decimal arrays. That is, passing the argument 'bar' from a custom
function to another function results in

arg[0]: 98
arg[1]: 97
arg[2]: 114

Here's a full example in case I'm doing something wrong here.

Function 1:

module Puppet::Parser::Functions
newfunction(:foo) do |args|
puts 'args[0]:' + args[0].to_s
puts 'args.size:' + args.size.to_s
end
end

Function 2:

module Puppet::Parser::Functions
newfunction(:foo2) do |args|
Puppet::Parser::Functions.autoloader.loadall
function_foo('from_function')
end
end

A manifest:

foo('from_manifest')
foo2()

Puppet Agent run Result:

args[0]:from_manifest
args.size:1
args[0]:102
args.size:13

13 is the string length of 'from_function', and 102 is the decimal
representation of 'f'.

- Adam

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/mdCdbqkswjUJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedJun 22, '12 at 3:20p
activeJun 25, '12 at 10:06a
posts5
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase