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

Signed-off-by: Markus Roberts <mar...@reality.com>
---
Local-branch: feature/next/resource_application_order
 lib/puppet/type.rb      |    8 +-------
 lib/puppet/type/file.rb |    2 --
 lib/puppet/type/tidy.rb |    4 +++-
 3 files changed, 4 insertions(+), 10 deletions(-)

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
-- 
1.7.0.4

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to