Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread Mark Rosedale
<> This turned out to be the issue. I don't typically restart the puppet master when I'm doing other fast fire development so it slipped my mind, but in this case it is absolutely required. I did some testing, and if you change code, even remove all the code, but don't restart the puppetmaster

Re: [Puppet Users] custom function error undefined local variable

2014-10-10 Thread jcbollinger
On Monday, October 6, 2014 11:07:46 AM UTC-5, Mark Rosedale wrote: > > Still haven't been able to hunt down the cause of this issue. Is there a > way to test the code with the puppet wrapping on the cli? > > As Jose suggested, use irb to test the generic parts. As far as I can tell, however,

Re: [Puppet Users] custom function error undefined local variable

2014-10-09 Thread Sebastiaan van Steenis
Second thought, could you show the init.pp file in vivox/manifests ? Or just the relevant parts around line 69? On 10 Oct 2014, at 08:10, Sebastiaan van Steenis wrote: > I cannot reproduce your error, but your function does conflict with some > internals I guess. I have some other modules fail

Re: [Puppet Users] custom function error undefined local variable

2014-10-09 Thread Sebastiaan van Steenis
I cannot reproduce your error, but your function does conflict with some internals I guess. I have some other modules failing when I use your function. If I simplify your function (https://gist.github.com/superseb/fdb443e86a8470a276a5) it works just fine. What other modules and/or custom functi

Re: [Puppet Users] custom function error undefined local variable

2014-10-09 Thread Mark Rosedale
Puppet 3.5.1 ruby 1.8.7 Output is: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined local variable or method `dns' for # at /etc/puppet/modules/vivox/manifests/init.pp:69 on node xxx Warning: Not using cache on failed catalog Error: Could not retrieve catalo

Re: [Puppet Users] custom function error undefined local variable

2014-10-09 Thread Mark Rosedale
Puppet 3.5.1 ruby 1.8.7 Output is: Error: Could not retrieve catalog from remote server: Error 400 on SERVER: undefined local variable or method `dns' for # at /etc/puppet/modules/vivox/manifests/init.pp:69 on node plab5qamaster.vivox.com Warning: Not using cache on failed catalog Error: Coul

Re: [Puppet Users] custom function error undefined local variable

2014-10-06 Thread Sebastiaan van Steenis
What version are you running? And what is the output if you try to call the function as you have it now? On 06 Oct 2014, at 19:07, José Luis Ledesma wrote: > Credits go to Nan Liu: > > If you are developing facts, it's much easier to just drop into IRB and get > everything working there rathe

Re: [Puppet Users] custom function error undefined local variable

2014-10-06 Thread José Luis Ledesma
Credits go to Nan Liu: If you are developing facts, it's much easier to just drop into IRB and get everything working there rather than doing round trip debugging between puppet and facter: irb(main):001:0> require 'facter' => true irb(main):002:0> Facter.value("hostname") => "demo-1" irb(mai

Re: [Puppet Users] custom function error undefined local variable

2014-10-06 Thread Mark Rosedale
Still haven't been able to hunt down the cause of this issue. Is there a way to test the code with the puppet wrapping on the cli? On Friday, October 3, 2014 3:41:57 PM UTC-4, Mark Rosedale wrote: > > Wil, > > Thanks for the reply. I will look up the module functions you reference. > Though, p

Re: [Puppet Users] custom function error undefined local variable

2014-10-03 Thread Mark Rosedale
Wil, Thanks for the reply. I will look up the module functions you reference. Though, part of this was writing the custom function as a learning exercise. So if I have a file with the following in it and run it through ruby it works. require 'resolv' Resolv::DNS.open do |dns| ress = dns

Re: [Puppet Users] custom function error undefined local variable

2014-10-02 Thread Wil Cooley
On Oct 2, 2014 10:23 AM, "Mark Rosedale" wrote: > > I have the following custom function that I'm trying to write. > Sorry this isn't an answer to your question, but I recently published a module of functions wrapping the standard system get*by* functions (well, wrapping Ruby's interfaces to the

[Puppet Users] custom function error undefined local variable

2014-10-02 Thread Mark Rosedale
I have the following custom function that I'm trying to write. require 'resolv' module Puppet::Parser::Functions newfunction(:getIpAddr, :type => :rvalue) do |arguments| Resolv::DNS.open do |dns| ress = dns.getresources(arguments[0], Resolv::DNS::Resource::IN::A) if ress.any?