tickets | 1 Mar 08:35 2012

[Puppet - Bug #12904] (Unreviewed) Deprecation warning about var not being fully qualified, yet it is local to scope of block in ERB

Issue #12904 has been reported by Joe McDonagh.

Bug #12904: Deprecation warning about var not being fully qualified, yet it is local to scope of block in ERB

  • Author: Joe McDonagh
  • Status: Unreviewed
  • Priority: Normal
  • Assignee:
  • Category:
  • Target version:
  • Affected Puppet version:
  • Keywords:
  • Branch:

Take this code example:

` <% scope.function_getinfo(‘Class’, ‘berkleemedia::lpm’, ‘fqdn’).each do |host| –%>

BalancerMember http://<%= host -%> retry=1

<% end –%>

ProxySet lbmethod=byrequests SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1


I’m getting deprecations warnings that “host” isn’t fully qualified, which is really weird since its scope is just in that block. Not sure if this matters but here is the custom function getinfo code:

` require ‘puppet/rails’ require ‘puppet/rails/fact_value’

module Puppet::Parser::Functions newfunction(:getinfo, :type => :rvalue, :doc => “This is a function that will return an array of information based on what you ask for. For example this call:

getinfo('Class', 'httpd', 'ec2_public_ipv4')

will return a list of the ec2_public_ipv4 fact values for any node that has the resource Class[‘httpd’]. If you leave off the third argument, fqdn will be assumed. Also note you can pass an environment to this function, but likely you won’t need to because by default it will find the node’s environment and use that. “) do |args|

resource_type = args[0] resource_title = args[1] return_info = args[2] environment = args[3] return_info ||= "fqdn" environment ||= lookupvar("::environment") raise Puppet::ParseError, ("getinfo(): wrong number of arguments (#{args.length}; must be >= 2)") if args.length < 2 info = [ ] info = Puppet::Rails::FactValue.find_by_sql(" SELECT fv.value from fact_values fv, fact_names fn, resources r, hosts h WHERE = '#{return_info}' AND h.environment = '#{environment}' AND = r.host_id AND r.restype = '#{resource_type}' AND r.title = '#{resource_title}' AND fv.host_id = AND fv.fact_name_id =; ")! { |i| i.value } info

end end


You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here:

You received this message because you are subscribed to the Google Groups "Puppet Bugs" group.
To post to this group, send email to puppet-bugs <at>
To unsubscribe from this group, send email to puppet-bugs+unsubscribe <at>
For more options, visit this group at