summaryrefslogtreecommitdiff
path: root/lib/chef/util
diff options
context:
space:
mode:
authorTim Smith <tsmith84@gmail.com>2020-02-18 15:59:16 -0800
committerTim Smith <tsmith84@gmail.com>2020-02-18 15:59:16 -0800
commitf64cf7ddf79259a71c5adfdcd1ecba9b85122b01 (patch)
tree6e33ae32feb1e8acec42c8d0f06a1bb85de2233c /lib/chef/util
parentc9414338729decf217c8bfc37b1d405619c44331 (diff)
downloadchef-f64cf7ddf79259a71c5adfdcd1ecba9b85122b01.tar.gz
Chefstyle fixes identified with Rubocop 0.80
The new Rubocop detects more unnecessary returns. This fixes these ahead of time so we can roll out the new Rubocop engine without breaking builds later. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'lib/chef/util')
-rw-r--r--lib/chef/util/diff.rb6
-rw-r--r--lib/chef/util/selinux.rb4
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/chef/util/diff.rb b/lib/chef/util/diff.rb
index 326f67a38e..a8b670ca9c 100644
--- a/lib/chef/util/diff.rb
+++ b/lib/chef/util/diff.rb
@@ -152,14 +152,14 @@ class Chef
if !diff_str.empty? && diff_str != "No differences encountered\n"
if diff_str.length > diff_output_threshold
- return "(long diff of over #{diff_output_threshold} characters, diff output suppressed)"
+ "(long diff of over #{diff_output_threshold} characters, diff output suppressed)"
else
diff_str = encode_diff_for_json(diff_str)
@diff = diff_str.split("\n")
- return "(diff available)"
+ "(diff available)"
end
else
- return "(no diff)"
+ "(no diff)"
end
end
diff --git a/lib/chef/util/selinux.rb b/lib/chef/util/selinux.rb
index 7e477b016c..6840971536 100644
--- a/lib/chef/util/selinux.rb
+++ b/lib/chef/util/selinux.rb
@@ -75,9 +75,9 @@ class Chef
cmd = shell_out!(selinuxenabled_path, returns: [0, 1])
case cmd.exitstatus
when 1
- return false
+ false
when 0
- return true
+ true
else
raise "Unknown exit code from command #{selinuxenabled_path}: #{cmd.exitstatus}"
end