Dear all, I'm trying this thing for a while but can't figure out what am I doing wrong. Here is my sample function (which is similar to the original one, except for the hash, which is generated dynamically in the original one):
module Puppet::Parser::Functions > newfunction(:am_running_oss, :type => :rvalue ) do |args| > > oss = {:linux=>["Slackware", "RedHat", "Caldera"], > :mac=>["Jaguar", "Lion", "Tiger", "Kodiak"], > :win=>["Chicago", "Daytona", "Longhorn"]} > > cls = args[0] > > if oss.key?(cls) > return oss[cls][0] > else > return 'undefined' > end > end > end > and then in my module's init.pp, I have this: $h= am_running_oss($::am_os_type) > notify { "=*=*= amRunningOS <|:|> ${h} =*=*=*=*=*=*=*=": } > (am_os_type is a fact, that returns *win*, *mac* or *linux* based on the node type) I was expecting to see *Jaguar* as the return value but I get *undefined*instead. What am I doing wrong? Is there anything still am I missing in terms of passing the *args* to the function? Cheers!! -- 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 puppet-users+unsubscr...@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users. For more options, visit https://groups.google.com/groups/opt_out.