After the fix for #1469, recurselimit = 0 was considered as
an infinite recursion which is the reverse of what it was before.

Signed-off-by: Brice Figureau <[email protected]>
---
 lib/puppet/file_serving/fileset.rb |    4 ++--
 spec/unit/file_serving/fileset.rb  |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/puppet/file_serving/fileset.rb 
b/lib/puppet/file_serving/fileset.rb
index 2076d0c..a6a4b62 100644
--- a/lib/puppet/file_serving/fileset.rb
+++ b/lib/puppet/file_serving/fileset.rb
@@ -67,7 +67,7 @@ class Puppet::FileServing::Fileset
         @ignore = []
         @links = :manage
         @recurse = false
-        @recurselimit = 0 # infinite recursion
+        @recurselimit = :infinite
 
         if options.is_a?(Puppet::Indirector::Request)
             initialize_from_request(options)
@@ -90,7 +90,7 @@ class Puppet::FileServing::Fileset
     # place for all of the logic around recursion.
     def recurse?(depth)
         # recurse if told to, and infinite recursion or current depth not at 
the limit
-        self.recurse and (self.recurselimit == 0 or depth <= self.recurselimit)
+        self.recurse and (self.recurselimit == :infinite or depth <= 
self.recurselimit)
     end
 
     def initialize_from_hash(options)
diff --git a/spec/unit/file_serving/fileset.rb 
b/spec/unit/file_serving/fileset.rb
index 6269d34..55cc2a9 100755
--- a/spec/unit/file_serving/fileset.rb
+++ b/spec/unit/file_serving/fileset.rb
@@ -51,9 +51,9 @@ describe Puppet::FileServing::Fileset, " when initializing" do
         Puppet::FileServing::Fileset.new("/some/file").recurse.should == false
     end
 
-    it "should default to 0 (infinite) for recurselimit" do
+    it "should default to :infinite for recurselimit" do
         File.expects(:lstat).with("/some/file").returns stub("stat")
-        Puppet::FileServing::Fileset.new("/some/file").recurselimit.should == 0
+        Puppet::FileServing::Fileset.new("/some/file").recurselimit.should == 
:infinite
     end
 
     it "should default to an empty ignore list" do
@@ -117,7 +117,7 @@ describe Puppet::FileServing::Fileset, " when determining 
whether to recurse" do
 
     it "should always recurse if :recurse is set to 'true' and with infinite 
recursion" do
         @fileset.recurse = true
-        @fileset.recurselimit = 0
+        @fileset.recurselimit = :infinite
         @fileset.recurse?(0).should be_true
     end
 
-- 
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