summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortimh <tim@opscode.com>2012-10-24 12:45:56 -0700
committertimh <tim@opscode.com>2012-10-24 12:46:13 -0700
commitfe5fd93fe7de90f1658b8a97b50c3a3642562dc0 (patch)
treee3d1d272627967cbd27914d9c5b6315f85a2cac6
parente4419e4144ecca0742d224a5f03d94ff91608515 (diff)
downloadchef-fe5fd93fe7de90f1658b8a97b50c3a3642562dc0.tar.gz
work around CHEF-3554 in windows by disabling this information collection
-rw-r--r--chef/lib/chef/provider/file.rb21
1 files changed, 18 insertions, 3 deletions
diff --git a/chef/lib/chef/provider/file.rb b/chef/lib/chef/provider/file.rb
index 659afc6517..faf0bf5422 100644
--- a/chef/lib/chef/provider/file.rb
+++ b/chef/lib/chef/provider/file.rb
@@ -142,6 +142,13 @@ class Chef
end
def load_current_resource_attrs
+ if Chef::Platform.windows?
+ # TODO: To work around CHEF-3554, add support for Windows
+ # equivalent, or implicit resource reporting won't work for
+ # Windows.
+ return
+ end
+
if ::File.exist?(@new_resource.path)
stat = ::File.stat(@new_resource.path)
@current_resource.owner(stat.uid)
@@ -215,13 +222,21 @@ class Chef
# override the default with the tempfile, since the
# file at @new_resource.path will not be updated on converge
def update_new_file_state(path=@new_resource.path)
+ if !::File.directory?(path)
+ @new_resource.checksum(checksum(path))
+ end
+
+ if Chef::Platform.windows?
+ # TODO: To work around CHEF-3554, add support for Windows
+ # equivalent, or implicit resource reporting won't work for
+ # Windows.
+ return
+ end
+
stat = ::File.stat(path)
@new_resource.owner(stat.uid)
@new_resource.mode(stat.mode & 07777)
@new_resource.group(stat.gid)
- if !::File.directory?(path)
- @new_resource.checksum(checksum(path))
- end
end
def action_create