Skip to content

Commit f3606ca

Browse files
authored
Merge pull request sous-chefs#606 from sous-chefs/automated/cookstyle
Automated PR: Cookstyle Changes
2 parents a72cd7f + 90cd88a commit f3606ca

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
This file is used to list changes made in each version of the Java cookbook.
44

5+
## Unreleased
6+
7+
- resolved cookstyle error: resources/alternatives.rb:49:13 refactor: `ChefCorrectness/ChefApplicationFatal`
8+
- resolved cookstyle error: resources/alternatives.rb:62:13 refactor: `ChefCorrectness/ChefApplicationFatal`
9+
- resolved cookstyle error: resources/alternatives.rb:75:11 refactor: `ChefCorrectness/ChefApplicationFatal`
10+
- resolved cookstyle error: resources/jce.rb:51:6 refactor: `ChefStyle/UnnecessaryOSCheck`
11+
512
## 8.1.0 (10-04-2020)
613

714
- Added `openjdk_pkg_install` resource & documentation

resources/alternatives.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
remove_cmd = shell_out("#{alternatives_cmd} --remove #{cmd} #{alt_path}")
4747
alternative_exists = false
4848
unless remove_cmd.exitstatus == 0
49-
Chef::Application.fatal!(%( remove alternative failed ))
49+
raise(%( remove alternative failed ))
5050
end
5151
end
5252
end
@@ -59,7 +59,7 @@
5959
end
6060
install_cmd = shell_out("#{alternatives_cmd} --install #{bin_path} #{cmd} #{alt_path} #{priority}")
6161
unless install_cmd.exitstatus == 0
62-
Chef::Application.fatal!(%( install alternative failed ))
62+
raise(%( install alternative failed ))
6363
end
6464
end
6565
end
@@ -72,7 +72,7 @@
7272
Chef::Log.debug "Setting alternative for #{cmd}"
7373
set_cmd = shell_out("#{alternatives_cmd} --set #{cmd} #{alt_path}")
7474
unless set_cmd.exitstatus == 0
75-
Chef::Application.fatal!(%( set alternative failed ))
75+
raise(%( set alternative failed ))
7676
end
7777
end
7878
end

resources/jce.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# JRE installation does not have a jre folder
4949
jre_path = node['java']['install_type'] == 'jdk' ? 'jre' : ''
5050

51-
if node['os'] == 'windows'
51+
if platform_family?('windows')
5252

5353
staging_path = ::File.join(jce_home, jdk_version)
5454
staging_local_policy = ::File.join(staging_path, "UnlimitedJCEPolicyJDK#{jdk_version}", 'local_policy.jar')

0 commit comments

Comments
 (0)