cloudsmith/geppetto — Issue #291: custom function without doc is not recognized
Author: hlindberg
Created: 2012-02-20 15:36:43+00:00
State: open

With this custom function

# This function checks that the fqdn of a host is in the
# $masternodes variable (which has to exist for this to work).
Puppet::Parser::Functions::newfunction(:ensureAuthorizedHost) do |vals|
Puppet::Parser::Functions.autoloader.loadall
masternodes = lookupvar('masternodes')
unless masternodes.include?(lookupvar('clientcert'))
raise Puppet::ParseError, "#{lookupvar('clientcert')}(#{lookupvar('ipaddress')}) tried to access a restricted module!"
end
end

Geppetto does not recognize it as a function. Changing to

Puppet::Parser::Functions::newfunction(:ensureAuthorizedHost, :doc => "Ensure that a user has access to a module.") do |vals|

makes it work.