Hi Folks I got a problem using the defined function in my custom function. In our Puppet environment we have some "xml files", where our service dependent things are stored. I wrote a custom function which catches a "puppet-part" inside the xml and creates resources with the create_resources function. That workts fine. BUT if a resource is defined more than once i got the duplicate definition error (makes sense!). I tried catching this error with the defined() function. This always result in "false". Can anybody tell me what i''m doing wrong?!? Here''s my custom function: require ''rexml/document'' module Puppet::Parser::Functions newfunction(:svc_to_resource2) do |args| Puppet::Parser::Functions.autoloader.loadall @xmlfile = args[0] file = File.new( "#{@xmlfile}" ) doc = REXML::Document.new file doc.elements.each("/service/puppet/resource") { |element| @rname = element.attributes["name"] @rtype = element.attributes["type"] myresource = { @rname => { } } element.elements.each("/service/puppet/ resource[@name=''#{@rname}'']/attribute") { |subelement| @aname = subelement.attributes["name"] @avalue = subelement.get_text.to_s myresource[@rname][@aname] = @avalue } if not function_defined("#{@rtype}[#{@rname}]") function_create_resources(@rtype, myresource) end } end end Thanks in advance! Bob -- 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 this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.