Skip to content

Commit

Permalink
add bracket on node if using proxy and node has ipv6 address (#2245)
Browse files Browse the repository at this point in the history
* add brackets "[]" if @node.ip is ipv6 using proxy

* add ipaddress dependency

* remove ipaddress gem dependency

* remove ipaddress gem dependency

opted to use "include" to validate if the ip address has the colon `:` string, instead of `ipaddress` gem

* removing `if` statement

looks like `[ip]` works even with ipv4 address.
so no need for an if statement.
much simpler change
  • Loading branch information
davama authored Feb 26, 2021
1 parent c0dae48 commit 8179f48
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oxidized/input/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def make_ssh_opts
if (proxy_port = vars(:ssh_proxy_port))
proxy_command += "-p #{proxy_port} "
end
proxy_command += "#{proxy_host} -W %h:%p"
proxy_command += "#{proxy_host} -W [%h]:%p"
proxy = Net::SSH::Proxy::Command.new(proxy_command)
ssh_opts[:proxy] = proxy
end
Expand Down

0 comments on commit 8179f48

Please sign in to comment.