summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-12-08 00:00:17 -0600
committerJames Turnbull <james@lovedthanlost.net>2008-12-08 17:06:44 +1100
commit8616d74b47ac9177a3f29f1ebf63902bdefb3275 (patch)
tree065d6f9bc08d22bb0de4366947dd8612366c863a /lib/puppet
parent6075d10373dbdb7de1f665cc39453daa6418cffd (diff)
downloadpuppet-8616d74b47ac9177a3f29f1ebf63902bdefb3275.tar.gz
puppet-8616d74b47ac9177a3f29f1ebf63902bdefb3275.tar.xz
puppet-8616d74b47ac9177a3f29f1ebf63902bdefb3275.zip
Fixing #1800 - tidy now correctly ignores missing files and directories
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rwxr-xr-xlib/puppet/type/tidy.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/puppet/type/tidy.rb b/lib/puppet/type/tidy.rb
index e37da5ef8..b4df4a9a2 100755
--- a/lib/puppet/type/tidy.rb
+++ b/lib/puppet/type/tidy.rb
@@ -44,7 +44,14 @@ module Puppet
end
def insync?(is)
- if File.lstat(resource[:path]).ftype == "directory" and ! @resource[:rmdirs]
+ begin
+ stat = File.lstat(resource[:path])
+ rescue Errno::ENOENT
+ info "Tidy target does not exist; ignoring"
+ return true
+ end
+
+ if stat.ftype == "directory" and ! @resource[:rmdirs]
self.debug "Not tidying directories"
return true
end