kernel/v2: always forward SSH [GH-4437]

This commit is contained in:
Mitchell Hashimoto 2014-09-04 14:19:47 -07:00
parent b8aaac893d
commit 8655d212c3
3 changed files with 11 additions and 3 deletions

View File

@ -2,6 +2,7 @@
BUG FIXES: BUG FIXES:
- core: forward SSH even if WinRM is used. [GH-4437]
- communicator/ssh: Fix crash when pty is enabled with SSH. [GH-4452] - communicator/ssh: Fix crash when pty is enabled with SSH. [GH-4452]
- guests/redhat: Detect various RedHat flavors. [GH-4462] - guests/redhat: Detect various RedHat flavors. [GH-4462]
- guests/redhat: Fix typo causing crash in configuring networks. [GH-4438] - guests/redhat: Fix typo causing crash in configuring networks. [GH-4438]

View File

@ -374,7 +374,9 @@ module VagrantPlugins
id: "winrm", id: "winrm",
auto_correct: true auto_correct: true
end end
elsif !@__networks["forwarded_port-ssh"] end
if !@__networks["forwarded_port-ssh"]
network :forwarded_port, network :forwarded_port,
guest: 22, guest: 22,
host: 2222, host: 2222,

View File

@ -182,12 +182,17 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
subject.communicator = "winrm" subject.communicator = "winrm"
subject.finalize! subject.finalize!
n = subject.networks n = subject.networks
expect(n.length).to eq(1) expect(n.length).to eq(2)
expect(n[0][0]).to eq(:forwarded_port) expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(5985) expect(n[0][1][:guest]).to eq(5985)
expect(n[0][1][:host]).to eq(55985) expect(n[0][1][:host]).to eq(55985)
expect(n[0][1][:host_ip]).to eq("127.0.0.1") expect(n[0][1][:host_ip]).to eq("127.0.0.1")
expect(n[0][1][:id]).to eq("winrm") expect(n[0][1][:id]).to eq("winrm")
expect(n[1][0]).to eq(:forwarded_port)
expect(n[1][1][:guest]).to eq(22)
expect(n[1][1][:host]).to eq(2222)
expect(n[1][1][:id]).to eq("ssh")
end end
it "allows overriding SSH" do it "allows overriding SSH" do
@ -210,7 +215,7 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
subject.finalize! subject.finalize!
n = subject.networks n = subject.networks
expect(n.length).to eq(1) expect(n.length).to eq(2)
expect(n[0][0]).to eq(:forwarded_port) expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(22) expect(n[0][1][:guest]).to eq(22)
expect(n[0][1][:host]).to eq(14100) expect(n[0][1][:host]).to eq(14100)