That got it! Thanks Guys... My Ruby is slowly improving...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from
Quick refactoring recommendation:
Pull the lookup out into a helper
attr_reader :physical_proxies
@physical_proxies = { XXX => "proxyX", XXY => "proxyY", ... }
def proxy_lookup(virtal, ip)
if virtual == "physical"
physical_proxies[ip.split(/\./)[1]]
elsif virtual == "openvz"
some_oth
In general, ruby does not allow an explicit 'return' within blocks.
Feel free to read up on the gory details, but basically, have the last
statement in your block be the value you want to return, rather than
an explicit return.
On Jan 12, 2009, at 10:51 AM, Jeff Leggett wrote:
>
> If I do t
If I do that, it blows up:
[jlegg...@lxp6d11m8v190 facter]$ facter
/opt/etrade/p6/lib/ruby/site_ruby/1.8/facter/etproxy.rb:36: unexpected
return (LocalJumpError)
from /opt/etrade/p6/lib/ruby/site_ruby/1.8/facter/util/
resolution.rb:117:in `call'
from /opt/etrade/p6/lib/ruby/site_r
You need to return a value, not to print it...
try replacing put with return.
Ohad
On Sat, Jan 10, 2009 at 1:53 AM, Jeff Leggett wrote:
>
> OK Good to know, updated... So no error now but it still output the
> facter value etproxy at the beginning of the facter outpout and
> without an identifi
OK Good to know, updated... So no error now but it still output the
facter value etproxy at the beginning of the facter outpout and
without an identifier:
[jlegg...@lxp6d11m8v190 facter]$ facter
10.X.Y.Z:8080
architecture => i386
domain => etrade.com
facterversion => 1.5.2
fqdn => lxp6d11m8v190.e
Sorry, no need for the require 'facter' as you are already running inside
it... (dahaa.) but if you want to try it out on irb or similar you need it.
Ohad
On Fri, Jan 9, 2009 at 5:51 PM, Ohad Levy wrote:
> try in your code:
>
> require 'facter'
>
> Facter.value(:ipaddress) ( or Facter.ipaddress
try in your code:
require 'facter'
Facter.value(:ipaddress) ( or Facter.ipaddress)
Cheers,
Ohad
On Fri, Jan 9, 2009 at 2:41 PM, Jeff Leggett wrote:
>
> That may be the problem - I call it by:
>
> ipaddr = `facter ipaddress`.chomp
>
> On Jan 8, 4:22 pm, James Turnbull wrote:
> > -BEGIN PGP
That may be the problem - I call it by:
ipaddr = `facter ipaddress`.chomp
On Jan 8, 4:22 pm, James Turnbull wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
>
>
> Jeff Leggett wrote:
> > So I wrote a new fact to determine clients proxy. Work's great when
> > I call it via facter
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Jeff Leggett wrote:
> So I wrote a new fact to determine clients proxy. Work's great when
> I call it via facter as a single:
>
> [jlegg...@lxp6d11m8v190 jleggett]$ facter etproxy
> 10.X.Y.Z:8080
>
> But when I call facter alone (for full output o
10 matches
Mail list logo