(#12884) Use default ssh.private_key_path when ssh.keys_only = false
This commit is contained in:
parent
241810b28a
commit
15df2c69b4
@ -501,7 +501,7 @@ module Vagrant
|
||||
if !info[:private_key_path] && !info[:password]
|
||||
if @config.ssh.private_key_path
|
||||
info[:private_key_path] = @config.ssh.private_key_path
|
||||
elsif info[:keys_only]
|
||||
else
|
||||
info[:private_key_path] = @env.default_private_key_path
|
||||
end
|
||||
end
|
||||
|
||||
@ -777,6 +777,16 @@ describe Vagrant::Machine do
|
||||
)
|
||||
end
|
||||
|
||||
it "should return the default private key path with keys_only = false" do
|
||||
provider_ssh_info[:private_key_path] = nil
|
||||
instance.config.ssh.private_key_path = nil
|
||||
instance.config.ssh.keys_only = false
|
||||
|
||||
expect(instance.ssh_info[:private_key_path]).to eq(
|
||||
[instance.env.default_private_key_path.to_s]
|
||||
)
|
||||
end
|
||||
|
||||
it "should not set any default private keys if a password is specified" do
|
||||
provider_ssh_info[:private_key_path] = nil
|
||||
instance.config.ssh.private_key_path = nil
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user