summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Mundrawala <jdmundrawala@gmail.com>2015-09-22 11:15:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2015-10-24 20:25:12 -0700
commit785161565f2e1f29395cc59c1cc52b0ae555b93b (patch)
tree0e923257288f9167605d139586709b35fd3cf123
parent3fea6de7368c26335b7446e9898459776723fcab (diff)
downloadchef-785161565f2e1f29395cc59c1cc52b0ae555b93b.tar.gz
allow generate_checksum to use StringIO
-rw-r--r--lib/chef/digester.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/digester.rb b/lib/chef/digester.rb
index 75c4e76859..f2b496b785 100644
--- a/lib/chef/digester.rb
+++ b/lib/chef/digester.rb
@@ -38,7 +38,11 @@ class Chef
end
def generate_checksum(file)
- checksum_file(file, OpenSSL::Digest::SHA256.new)
+ if file.is_a?(StringIO)
+ checksum_io(file, OpenSSL::Digest::SHA256.new)
+ else
+ checksum_file(file, OpenSSL::Digest::SHA256.new)
+ end
end
def self.generate_md5_checksum_for_file(*args)