Issue #2110 has been updated by micah.

Status changed from Closed to Re-opened

I was getting this issue, so I applied this fix to my 0.24.8 and tried it out 
but I'm still getting the error:

<pre>
err: Could not retrieve catalog: Failed to parse template 
backupninja/rdiff.conf.erb: private method `versioncmp' called for 
Puppet::Parser::TemplateWrapper::VersionComparer:Class at 
/etc/puppet/modules/backupninja/manifests/rdiff.pp:52
</pre>

The code I'm using is:

<pre>
<%- include Puppet::Util::Package
    class VersionComparer; extend Puppet::Util::Package; end
    
    if VersionComparer.versioncmp(Puppet.version,'0.24.6') >= 0
        %w{type host directory user sshoptions}.each do |v|
                if has_variable?(v) and instance_variable_get("@#{v}").to_s != 
"false"
                -%>
<%= v + ' = ' + instance_variable_get("@#{v}").to_s %>
</pre>

----------------------------------------
Bug #2110: versioncmp broken
http://projects.reductivelabs.com/issues/2110

Author: volcane
Status: Closed
Priority: Normal
Assigned to: masterzen
Category: functions
Target version: 0.25.0
Complexity: Unknown
Affected version: 0.24.8
Keywords: 


hello,

the versioncmp function in 0.24.8 is broken:

<pre>

Puppet::Parser::Functions::newfunction(:versioncmp, :doc => "Compares two 
versions.") do |args|
   <snip>
    return Puppet::Util::Package.versioncmp(args[0], args[1])
end

</pre>

clearly the function is supposed to return a value, however the newfunction() 
call does not set it to return anything resulting in:

Function 'versioncmp' does not return a value at /home/rip/test.pp:1 on node 
nephilim.ml.org

when used. 

Simply adding ':type => :rvalue' to the newfunction() call fixes it.



-- 
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: 
http://reductivelabs.com/redmine/my/account

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to