Initially I had the custom function in a helper module and was referencing 
it from another module. I have now tried adding the function the the only 
module that is using it. No luck, same error.

The custom function has been stripped down to the following:

module Puppet::Parser::Functions
    newfunction(:get_nodes, :type => :rvalue) do |args|
                return "FOO"
    end
end

I also tried again to test the function on the master using a test manifest 
test.pp:

$nodes = get_nodes()
notify { $nodes: } 

puppet appy test.pp --modulepath=./modules

This is successful on the puppet master. 
notice: FOO
notice: /Stage[main]//Notify[FOO]/message: defined 'message' as 'FOO'
notice: Finished catalog run in 0.18 seconds


It still fails when running from the node. "Could not retrieve catalog from 
remote server: wrong header line format"

It can't be a template issue as the module using it has templates and when 
I remove the get_nodes() function call it is successful.


On Wednesday, May 15, 2013 12:32:25 PM UTC-4, David Pires wrote:
>
> I have tried stripping the custom function (type rvalue) down to returning 
> a string to see if it some other error. No luck, same header error.
>
> The test manifest I was using was something like this:
>
> The function is simply returning a string of IP addresses from EC2 called 
> get_nodes()
>
> I've tried 2 ways of referencing the function
>
> 1) In the site manifest through a class parameter
> class { "": 
> ips => get_nodes()
> }
>
> 2) In the actual class
> $ips = get_nodes()
>
> Both give the same error and stop the catalog.
>
> On Wednesday, May 15, 2013 12:19:02 PM UTC-4, David Pires wrote:
>>
>> Just ran the template again, 'Syntax OK'
>>
>> Nothing in the masterhttp log. I really don't think its a template issue 
>> as all other modules work fine, its only when i add the reference to the 
>> function that I get the header error.
>>
>> Maybe its something about the directory structure of my module? I created 
>> a module like any other with no manifest at first, with the proper 
>> structure for plugins (lib/parser/functions etc.) I then added a blank 
>> class to the module manifest to see if that was the issue, and it wasn't 
>> same error...
>>
>> On Wednesday, May 15, 2013 12:03:02 PM UTC-4, (Dean Wilson) wrote:
>>>
>>> On Wed, May 15, 2013 at 08:46:57AM -0700, David Pires wrote: 
>>> > It compiles fine, no errors. Both the master and nodes are Ubuntu 
>>> 12.04, 
>>> > puppet version 2.7.11 
>>>
>>> Only time I've ever seen this message is in broken templates - which I 
>>> know you've already checked. Last time I saw it was an unmatched ' 
>>>
>>> Did you run something like erb -P -x -T '-' mytemplate.erb | ruby -c 
>>> over 
>>> each template? 
>>>
>>> Do you have anything in the http log? 
>>>
>>>   Dean 
>>> -- 
>>> Dean Wilson 
>>> http://www.unixdaemon.net       @unixdaemon 
>>> http://www.puppetcookbook.com   @puppetcookbook 
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to