summaryrefslogtreecommitdiff
path: root/lib/chef/util/diff.rb
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-06-05 12:45:27 -0700
committersersut <serdar@opscode.com>2013-06-05 12:45:27 -0700
commit9a643072ade2f8005d9f49a7a5821cebe6eee1ba (patch)
tree1d98a7d36249c17652f954e9548a704a06001a54 /lib/chef/util/diff.rb
parentd84f98788f7a625ee09c739edef1357e9fae890b (diff)
downloadchef-9a643072ade2f8005d9f49a7a5821cebe6eee1ba.tar.gz
Treat specialized diff output on Solaris as no diff.
Diffstat (limited to 'lib/chef/util/diff.rb')
-rw-r--r--lib/chef/util/diff.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index 5d47ec1d11..b01bc229b7 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -86,7 +86,11 @@ class Chef
# diff will set a non-zero return code even when there's
# valid stdout results, if it encounters something unexpected
# So as long as we have output, we'll show it.
- if not result.stdout.empty?
+ #
+ # Also on some platforms (Solaris) diff outputs a single line
+ # when there are no differences found. Look for this line
+ # before analyzing diff output.
+ if !result.stdout.empty? && result.stdout != "No differences encountered\n"
if result.stdout.length > diff_output_threshold
return "(long diff of over #{diff_output_threshold} characters, diff output suppressed)"
else
@@ -94,7 +98,7 @@ class Chef
@diff.delete("\\ No newline at end of file")
return "(diff available)"
end
- elsif not result.stderr.empty?
+ elsif !result.stderr.empty?
return "Could not determine diff. Error: #{result.stderr}"
else
return "(no diff)"