I'm in the process of upgrading an existing installation from .24.x to 2.6.

We seem to have a custom function that is throwing the error:
"err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
private method `gsub' called for #<Array:0x7fdcebf3bbf8> at 
/etc/puppet/manifests/classes/apache-php.pp:72"

Here is the function:
"""
# Checks if a file exists on the puppet maser
Puppet::Parser::Functions::newfunction(:bbcom_file_exists, :type => :rvalue,
        :doc => "Checks if the given file exists on the puppet master.") do 
|vals|
        ret = false

        vals.each do |file|
        # First convert our $puppet.... urls to local filesystems urls
        # We do this to allow the caller to use the same urls array
        # in other parts of the recipe.  
            file = file.gsub("puppet:///appconf/", "/etc/cdir/config/")

                # Now do the same for internal server files 
            file = file.gsub("puppet:///files/", "/etc/puppet/files/")
                
        unless file =~ /^#{File::SEPARATOR}/
            raise Puppet::ParseError, "Files must be fully qualified"
        end
        if File.exists?(file)
                ret = true
           break
        end
    end
        ret
end
"""
The function is used as a conditional: given a list of files puppet may be 
managing, if any of them exist on the server, then do this other thing (so 
far it usually means "manage this other file too").

Personally I'd love to be able to remove it as it seems clunky to me; but 
failing that if someone can point out why it is failing in 2.6 and how to 
fix it I would greatly appreciate it. I'm not much of a Ruby guy so while  I 
understand _what_ the error is telling me, fixing it is a different story.

Cheers,
Bill

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to