pass true as 2nd args for Net::SSH.configuration_for by default. #5726

Merged
merged 1 commit into from Jan 17, 2017
Jump to file or symbol
Failed to load files and symbols.
+2 −2
Split

pass true as 2nd args for Net::SSH.configuration_for by default.

Signed-off-by: SAWANOBORI Yukihiko <sawanoboriyu@higanworks.com>
  • Loading branch information...
commit 24d230b09a68c8b6857d060b398e779a23ba80bc @sawanoboly sawanoboly committed Jan 16, 2017
View
@@ -232,7 +232,7 @@ def search_nodes
# @param user [String] Optional username for this session.
# @return [Hash<Symbol, Object>]
def session_options(host, port, user = nil)
- ssh_config = Net::SSH.configuration_for(host)
+ ssh_config = Net::SSH.configuration_for(host, true)
{}.tap do |opts|
# Chef::Config[:knife][:ssh_user] is parsed in #configure_user and written to config[:ssh_user]
opts[:user] = user || config[:ssh_user] || ssh_config[:user]
@@ -190,7 +190,7 @@ def self.should_return_specified_attributes
before :each do
@knife.instance_variable_set(:@longest, 0)
ssh_config = { :timeout => 50, :user => "locutus", :port => 23 }
- allow(Net::SSH).to receive(:configuration_for).with("the.b.org").and_return(ssh_config)
+ allow(Net::SSH).to receive(:configuration_for).with("the.b.org", true).and_return(ssh_config)
end
it "uses the port from an ssh config file" do