]> gitweb.fluxo.info Git - puppet-backupninja.git/commitdiff
setup rdiff handler template to work properly for different versions of puppet
authorMicah Anderson <micah@riseup.net>
Mon, 8 Dec 2008 20:35:30 +0000 (15:35 -0500)
committerMicah Anderson <micah@riseup.net>
Mon, 8 Dec 2008 20:35:30 +0000 (15:35 -0500)
templates/rdiff.conf.erb

index 7fbfe73b532fdd3a840d1d8676c65566ee82dc87..0e19125da95df5edac1007259886d5a944dc7dc7 100644 (file)
@@ -28,8 +28,25 @@ type = local
 <% end -%>
 
 [dest]
-<% %w{type host directory user sshoptions}.each do |v|
-       if has_variable?(v)
-               -%><%= v + ' = ' + instance_variable_get("@#{v}") + "\n" %><%
-       end
-end -%>
+<%- 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)
+                -%>
+<%= v + ' = ' + instance_variable_get("@#{v}").to_s %>
+        <%-
+                end
+        end
+        %>
+<%- else -%>
+        <%- %w{type host directory user sshoptions}.each do |v|
+                if @scope.lookupvar(v)
+                -%>
+<%= v + ' = ' + @scope.lookupvar(v) %>
+        <%-
+                end
+        end
+        %>
+<%- end -%>