Skip to content

Commit

Permalink
Fix broken command options for java agent (#27)
Browse files Browse the repository at this point in the history
* Fix broken command options for java agent

A couple of the optional command line arguments to the java installer
were using a deprecated way to set the properties and check the
values of the attributes passed into the recipe. This went from a
deprecation warning to a hard error in Chef 13 and above.

Tested the fix using the comprehensive test suite for linux. Tested
on Centos 7.4, 64 bit.
  • Loading branch information
mosspilot authored and bespokebob committed Nov 29, 2018
1 parent 922ce76 commit 68ef700
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions resources/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@
end
if new_resource.proxy_hostname
options_array << '--proxy-host ' + new_resource.proxy_hostname
options_array << '--proxy-port ' + proxy_port.to_s if proxy_port != 1080
options_array << '--proxy-port ' + new_resource.proxy_port.to_s if new_resource.proxy_port != 1080
end
options_array << '--rtmport ' + rtm_port.to_s if new_resource.install_rtm && new_resource.rtm_port != 1169
options_array << '--rtmport ' + new_resource.rtm_port.to_s if new_resource.install_rtm && new_resource.rtm_port != 1169
if new_resource.fips
options_array << '--enable-fips'
options_array << '--http-port ' + new_resource.integration_port.to_s if new_resource.integration_port != 1080
Expand All @@ -121,7 +121,7 @@
# Editing config file to make the Java agent into a proxy
ruby_block 'Adding proxy settings to TE Agent' do
block do
pxy = Chef::Util::FileEdit.new(install_directory + '/data/config/agent.properties')
pxy = Chef::Util::FileEdit.new(new_resource.install_directory + '/data/config/agent.properties')
pxy.search_file_replace_line(/bootstrapables=station/, 'space.bootstrapables=station,socksProxy')
pxy.insert_line_after_match(/tw\.server.port/, 'tw.proxy.serverPort=' + new_resource.proxy_port.to_s)
pxy.write_file
Expand Down

0 comments on commit 68ef700

Please sign in to comment.