summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Heinen <theinen@tecracer.de>2020-08-17 16:27:37 +0200
committerThomas Heinen <theinen@tecracer.de>2020-08-17 16:27:37 +0200
commitbfa4d558eca86b52eeb4b7e2b00c6dfc50c12fa8 (patch)
treed84aa4fd351d756a53895c0c8ba2f6d7549cf078
parent331c5de616694a0ccbb5f81fbb6bc9ddd70ba94f (diff)
downloadchef-bfa4d558eca86b52eeb4b7e2b00c6dfc50c12fa8.tar.gz
Simplify implementation for checksum ellipsis
Signed-off-by: Thomas Heinen <theinen@tecracer.de>
-rw-r--r--lib/chef/exceptions.rb2
-rw-r--r--lib/chef/mixin/checksum.rb4
-rw-r--r--lib/chef/provider/file.rb2
3 files changed, 2 insertions, 6 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb
index 444fe82df1..52a2cc8439 100644
--- a/lib/chef/exceptions.rb
+++ b/lib/chef/exceptions.rb
@@ -423,7 +423,7 @@ class Chef
class ChecksumMismatch < RuntimeError
def initialize(res_cksum, cont_cksum)
- super "Checksum on resource (#{res_cksum}) does not match checksum on content (#{cont_cksum})"
+ super "Checksum on resource (#{res_cksum}...) does not match checksum on content (#{cont_cksum}...)"
end
end
diff --git a/lib/chef/mixin/checksum.rb b/lib/chef/mixin/checksum.rb
index 9fb3e13899..083e524d63 100644
--- a/lib/chef/mixin/checksum.rb
+++ b/lib/chef/mixin/checksum.rb
@@ -31,10 +31,6 @@ class Chef
checksum.slice(0, 6)
end
-
- def short_cksum_ellipsis(checksum)
- short_cksum(checksum) + "..."
- end
end
end
end
diff --git a/lib/chef/provider/file.rb b/lib/chef/provider/file.rb
index 394662eed9..0de620bba1 100644
--- a/lib/chef/provider/file.rb
+++ b/lib/chef/provider/file.rb
@@ -335,7 +335,7 @@ class Chef
def do_validate_content
if new_resource.checksum && tempfile && ( new_resource.checksum != tempfile_checksum )
- raise Chef::Exceptions::ChecksumMismatch.new(short_cksum_ellipsis(new_resource.checksum), short_cksum_ellipsis(tempfile_checksum))
+ raise Chef::Exceptions::ChecksumMismatch.new(short_cksum(new_resource.checksum), short_cksum(tempfile_checksum))
end
if tempfile