On Tue, 2009-02-17 at 07:42 -0800, Jeff wrote:
> puppetd --test
> notice: Ignoring cache
> err: Could not retrieve configuration: return can't jump across
> threads at /var/puppet/modules/atg/manifests/init.pp:298 on node
>
> On that line, I call this custom function:
>
> module Puppet::Parser::Functions
>
> require 'inifile'
>
> newfunction(:awi_ports, :type=>:rvalue) do |args|
> type = args[0]
> server = args[1]
> ini = IniFile::new( )
> ini.load("/var/puppet/modules/atg/manifests/ports.conf")
>
> if ini[type].nil? == true
> return -1
> end
>
> ini[type].each { |k, v|
> if k==server
> return v
> else
> return -1
> end
> }
> end
> end
It might be an issue with using return inside the block - I have dark
memories of screwing that up. IIRC, you can't use return inside the
block when the block is being passed around, and have to use the very
counter-intuitive 'next' instead.
David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---