summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2010-06-07 12:36:39 -0700
committerDaniel DeLeo <dan@opscode.com>2010-06-07 12:36:39 -0700
commitb6cb4042af0309d123fc61554e11908d8f16ebae (patch)
treedddc6461991e5678a34462483c22ba9e612b1575
parentb65274ef00566c223ff678acdf46c7a92caa3166 (diff)
downloadchef-b6cb4042af0309d123fc61554e11908d8f16ebae.tar.gz
[CHEF-1260] don't try to checksum files that don't exist
-rw-r--r--chef/lib/chef/provider/remote_file.rb2
-rw-r--r--chef/lib/chef/provider/template.rb4
2 files changed, 3 insertions, 3 deletions
diff --git a/chef/lib/chef/provider/remote_file.rb b/chef/lib/chef/provider/remote_file.rb
index 0a74555990..29c485a8f4 100644
--- a/chef/lib/chef/provider/remote_file.rb
+++ b/chef/lib/chef/provider/remote_file.rb
@@ -31,7 +31,7 @@ class Chef
def load_current_resource
super
- @current_resource.checksum(checksum(@current_resource.path))
+ @current_resource.checksum(checksum(@current_resource.path)) if ::File.exist?(@current_resource.path)
end
def action_create
diff --git a/chef/lib/chef/provider/template.rb b/chef/lib/chef/provider/template.rb
index 7dd5971f3e..256d56f8fc 100644
--- a/chef/lib/chef/provider/template.rb
+++ b/chef/lib/chef/provider/template.rb
@@ -33,13 +33,13 @@ class Chef
class Template < Chef::Provider::File
- #include Chef::Mixin::Checksum
+ include Chef::Mixin::Checksum
include Chef::Mixin::Template
#include Chef::Mixin::FindPreferredFile
def load_current_resource
super
- @current_resource.checksum(checksum(@current_resource.path))
+ @current_resource.checksum(checksum(@current_resource.path)) if ::File.exist?(@current_resource.path)
end
def action_create