[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Markus Roberts Markus at reality.com
Tue May 10 08:10:10 UTC 2011


The following commit has been merged in the experimental branch:
commit 127501e11bf89894ca01681259e54de45821aacd
Author: Markus Roberts <Markus at reality.com>
Date:   Wed Mar 30 15:32:59 2011 -0700

    (6911) Use normal methods to implement "depthfirst?" test
    
    There was a class instance variable that was used to determine if a resource
    types's children should be processed before or after the parent, to support
    the one type (tidy) which did this.  Instead, we define a normal function in
    Type to return false and override it in Tidy to return true.
    
    Paired-with: Jesse Wolfe

diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index d24cc85..5ecc430 100644
--- a/lib/puppet/type.rb
+++ b/lib/puppet/type.rb
@@ -598,14 +598,8 @@ class Type
   ###############################
   # Code related to the container behaviour.
 
-  # this is a retarded hack method to get around the difference between
-  # component children and file children
-  def self.depthfirst?
-    @depthfirst
-  end
-
   def depthfirst?
-    self.class.depthfirst?
+    false
   end
 
   # Remove an object.  The argument determines whether the object's
diff --git a/lib/puppet/type/file.rb b/lib/puppet/type/file.rb
index 1a6d0c3..2c5a95b 100644
--- a/lib/puppet/type/file.rb
+++ b/lib/puppet/type/file.rb
@@ -303,8 +303,6 @@ Puppet::Type.newtype(:file) do
     return self.new(:name => base, :recurse => true, :recurselimit => 1, :audit => :all).recurse_local.values
   end
 
-  @depthfirst = false
-
   # Determine the user to write files as.
   def asuser
     if self.should(:owner) and ! self.should(:owner).is_a?(Symbol)
diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb
index 146481f..d2e9ebe 100755
--- a/lib/puppet/type/tidy.rb
+++ b/lib/puppet/type/tidy.rb
@@ -209,7 +209,9 @@ Puppet::Type.newtype(:tidy) do
     []
   end
 
-  @depthfirst = true
+  def depthfirst?
+    true
+  end
 
   def initialize(hash)
     super

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list