summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2011-03-30 15:32:59 -0700
committerMarkus Roberts <Markus@reality.com>2011-03-30 15:32:59 -0700
commit127501e11bf89894ca01681259e54de45821aacd (patch)
tree31c37667c0100f578cc85340280c7b5730550a62 /lib/puppet
parent9c06fbd762cddcc41a7185a36f2a8e72879125eb (diff)
downloadpuppet-127501e11bf89894ca01681259e54de45821aacd.tar.gz
puppet-127501e11bf89894ca01681259e54de45821aacd.tar.xz
puppet-127501e11bf89894ca01681259e54de45821aacd.zip
(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
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/type.rb8
-rw-r--r--lib/puppet/type/file.rb2
-rwxr-xr-xlib/puppet/type/tidy.rb4
3 files changed, 4 insertions, 10 deletions
diff --git a/lib/puppet/type.rb b/lib/puppet/type.rb
index d24cc8554..5ecc430d4 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 1a6d0c3ac..2c5a95bbc 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 146481fed..d2e9ebe22 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