[Puppet Users] Re: Custom function: where to put the file?

Luke Kanies
Wed, 04 Jun 2008 18:30:51 -0000

On Jun 4, 2008, at 11:11 AM, Mike wrote:

> All I ever see in /var/log/messages on a client run is this:
>
> Jun  4 13:50:08 myhostname puppetmasterd[23529]:
> (Scope(Node[myhostname.mycompany.com]))  hello
> Jun  4 13:52:00 myhostname puppetd[23536]: Configuration retrieval
> timed out
> Jun  4 13:52:01 myhostname puppetd[23536]: Not using cache on failed
> catalog


This indicates to me that your server is finding the function and it''s
never returning.

Try running your function separately.  For instance, here''s a test
script I recently wrote for a demo function:

describe Puppet::Parser::Functions.function(:spectest) do
     it "should get added to the list of functions" do
         Puppet::Parser::Functions.function(:spectest).should_not
be_false
     end

     it "should be a statement" do
         Puppet::Parser::Functions.should_not be_rvalue(:spectest)
     end

     it "should create a function named ''spectest''"
do
         Puppet::Parser::Scope.instance_methods.should
be_include("function_spectest")
     end

     describe "when being executed" do
         it "should send an error message with its arguments" do
             Puppet.expects(:err).with("one two")
             Puppet::Parser::Scope.new.function_spectest(%w{one two})
         end
     end
end

--
Take the utmost trouble to find the right thing to say, and then say
it with the utmost levity. -- George Bernard Shaw
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com