summaryrefslogtreecommitdiff
path: root/lib/chef/provider/file.rb
diff options
context:
space:
mode:
authorAliasgar16 <aliasgar.batterywala@msystechnologies.com>2016-09-21 07:02:58 +0530
committerMatt Wrock <matt@mattwrock.com>2016-09-20 18:32:58 -0700
commit555abc008946f8b239a79809104b07062f9082ae (patch)
treee7b85f292f9bbf7a19ad9852c7309638bf04c5ad /lib/chef/provider/file.rb
parent19b3900b5f6a24009b8f14eb09d4105e721b9262 (diff)
downloadchef-555abc008946f8b239a79809104b07062f9082ae.tar.gz
Fixed undefined short_cksum method issue and checksum in uppercase issue for windows_package resource. (#5332)
* Fixed undefined short_cksum method issue and checksum in uppercase issue for windows_package resource. * Added RSpecs for the changes done here. * Fixed RSpecs issues.
Diffstat (limited to 'lib/chef/provider/file.rb')
-rw-r--r--lib/chef/provider/file.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 7f85085eeb..84bb4d1c94 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -344,7 +344,7 @@ class Chef
end
def do_validate_content
- if new_resource.checksum && tempfile && ( new_resource.checksum != tempfile_checksum )
+ if new_resource.checksum && tempfile && ( new_resource.checksum.downcase != tempfile_checksum )
raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(tempfile_checksum))
end
@@ -462,11 +462,6 @@ class Chef
@tempfile ||= content.tempfile
end
- def short_cksum(checksum)
- return "none" if checksum.nil?
- checksum.slice(0, 6)
- end
-
def load_resource_attributes_from_file(resource)
if Chef::Platform.windows?
# This is a work around for CHEF-3554.