Skip to content

Commit

Permalink
Proxy hostname fix (#17)
Browse files Browse the repository at this point in the history
* Fix issue #16 proxy_hostname must be one of String!

* Update changelog

* Revert changelog update

* Fix kitchen yml problem

* Review cleanup

* Correct lint argument

* Change to old truthy logic

* Remove deprecation warnings see https://docs.chef.io/deprecations_namespace_collisions.html
  • Loading branch information
MitchellJThomas authored and bespokebob committed Feb 7, 2018
1 parent 6434040 commit e8bff29
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ suites:
- a_windows_type
attributes:
tripwire_agent:
installer: ''D:\Path\To\Axon_Agent_x64.msi'
installer: 'D:\Path\To\Axon_Agent_x64.msi'
proxy_hostname: 'tw-proxy.example.com'
proxy_port: 1180
start_service: false
Expand All @@ -461,7 +461,7 @@ suites:
- a_debian_type
attributes:
tripwire_agent:
installer: ''D:\Path\To\Axon_Agent_x64.msi'
installer: 'D:\Path\To\Axon_Agent_x64.msi'
axon:
bridge: 'tw-bridge.perf.tripwire.com'
registration_key: '123PAs5W0rD'
Expand Down
2 changes: 1 addition & 1 deletion TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ chef exec bundle update

The lint stage runs Ruby specific code linting using cookstyle (<https://github.com/chef/cookstyle>).

`chef exec cookstyle . -lint`
`chef exec cookstyle . --lint`

### Syntax Testing

Expand Down
28 changes: 14 additions & 14 deletions resources/java.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
property :install_rtm, [true, false], default: true
property :rtm_port, Integer, default: 1169
property :proxy_agent, [true, false], default: false
property :proxy_hostname, String, default: ''
property :proxy_hostname, [String, nil], default: nil
property :proxy_port, Integer, default: 1080
property :fips, [true, false], default: false
property :integration_port, Integer, default: 8080
Expand Down Expand Up @@ -64,9 +64,9 @@
' INSTALL_RTM=' + new_resource.install_rtm.to_s

if new_resource.install_directory != def_install
options_array << 'INSTALLDIR=' + install_directory
options_array << 'INSTALLDIR=' + new_resource.install_directory
end
if !new_resource.proxy_hostname.empty?
if new_resource.proxy_hostname
options_array << 'TE_PROXY_HOSTNAME=' + new_resource.proxy_hostname
options_array << 'TE_PROXY_PORT=' + new_resource.proxy_port.to_s if new_resource.proxy_port != 1080
end
Expand All @@ -82,26 +82,26 @@
options_array << local_installer +
' --silent' \
' --eula accept' \
' --server-host ' + console +
' --server-port ' + console_port.to_s +
' --passphrase ' + services_password +
' --install-rtm ' + install_rtm.to_s
' --server-host ' + new_resource.console +
' --server-port ' + new_resource.console_port.to_s +
' --passphrase ' + new_resource.services_password +
' --install-rtm ' + new_resource.install_rtm.to_s

if install_directory != def_install
if new_resource.install_directory != def_install
if node['platform'] == 'debian' || node['platform'] == 'ubuntu'
raise 'Remove custom install directory, agent must use the default install path on this platform'
else
options_array << '--install-dir ' + install_directory
options_array << '--install-dir ' + new_resource.install_directory
end
end
if !proxy_hostname.empty?
options_array << '--proxy-host ' + proxy_hostname
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
end
options_array << '--rtmport ' + rtm_port.to_s if install_rtm && rtm_port != 1169
if fips
options_array << '--rtmport ' + 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 ' + integration_port.to_s if integration_port != 1080
options_array << '--http-port ' + new_resource.integration_port.to_s if new_resource.integration_port != 1080
end
end
cmd_str = options_array.join(' ')
Expand Down

0 comments on commit e8bff29

Please sign in to comment.