summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-08 07:36:46 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-03-08 07:36:46 +0000
commitf59cadec5c453ef15b457c9f5b08999c23c69d01 (patch)
treebed3c1d165e55039cfe9304886d1b808b00ebdd4 /lib
parentb6df3369bc8a1dadfab2c7baa6d4572785c075fb (diff)
downloadpuppet-f59cadec5c453ef15b457c9f5b08999c23c69d01.tar.gz
puppet-f59cadec5c453ef15b457c9f5b08999c23c69d01.tar.xz
puppet-f59cadec5c453ef15b457c9f5b08999c23c69d01.zip
Fixing a bug related to link recursion that caused link directories
to always be considered out of sync. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2269 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/type/pfile.rb2
-rw-r--r--lib/puppet/type/pfile/target.rb9
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index 60693b23a..e9500e07f 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -792,7 +792,7 @@ module Puppet
should
FileUtils.rmtree(self[:path])
else
- notice "Not replacing directory; use 'force' to override"
+ notice "Not removing directory; use 'force' to override"
end
when "link", "file":
debug "Removing existing %s for replacement with %s" %
diff --git a/lib/puppet/type/pfile/target.rb b/lib/puppet/type/pfile/target.rb
index 12e8ea732..c3c9031ec 100644
--- a/lib/puppet/type/pfile/target.rb
+++ b/lib/puppet/type/pfile/target.rb
@@ -24,9 +24,14 @@ module Puppet
def mklink
target = self.should
- # Clean up any existing objects.
+ # Clean up any existing objects. The argument is just for logging,
+ # it doesn't determine what's removed.
@parent.remove_existing(target)
+ if FileTest.exists?(@parent[:path])
+ raise Puppet::Error, "Could not remove existing file"
+ end
+
Dir.chdir(File.dirname(@parent[:path])) do
Puppet::Util::SUIDManager.asuser(@parent.asuser()) do
mode = @parent.should(:mode)
@@ -44,7 +49,7 @@ module Puppet
end
def insync?
- if [:nochange, :notlink].include?(self.should)
+ if [:nochange, :notlink].include?(self.should) or @parent.recurse?
return true
else
return super