Ticket #1469 introduced an incorrect change of behaviour where
recurse = 0 was considered as an infinite recursion, unlike
before.
This patch restores this behavior, and makes some test pass.

Signed-off-by: Brice Figureau <[email protected]>
---
 lib/puppet/type/file.rb |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 05a4b37..0cd9ebe 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -128,11 +128,20 @@ module Puppet
                 when :remote: :remote
                 when Integer, Fixnum, Bignum:
                     self.warning "Setting recursion depth with the recurse 
parameter is now deprecated, please use recurselimit"
+
+                    # recurse == 0 means no recursion
+                    return false if value == 0
+
                     resource[:recurselimit] = value
                     true
                 when /^\d+$/:
                     self.warning "Setting recursion depth with the recurse 
parameter is now deprecated, please use recurselimit"
-                    resource[:recurselimit] = Integer(value)
+                    value = Integer(value)
+
+                    # recurse == 0 means no recursion
+                    return false if value == 0
+
+                    resource[:recurselimit] = value
                     true
                 else
                     raise ArgumentError, "Invalid recurse value %s" % 
value.inspect
-- 
1.6.0.2


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to