core: allow overriding default SSH port [GH-3474]

This commit is contained in:
Mitchell Hashimoto 2014-04-15 10:37:08 -07:00
parent 19bd117b02
commit 20473fe4ca
3 changed files with 15 additions and 1 deletions

View File

@ -2,6 +2,7 @@
BUG FIXES:
- core: Allow overriding of the default SSH port. [GH-3474]
- commands/box/remove: Make output nicer. [GH-3470]
- commands/box/update: Show currently installed version. [GH-3467]
- command/rsync-auto: Works properly on Windows.

View File

@ -341,7 +341,7 @@ module VagrantPlugins
define(DEFAULT_VM_NAME) if defined_vm_keys.empty?
# Make sure the SSH forwarding is added if it doesn't exist
if !@__networks["ssh"]
if !@__networks["forwarded_port-ssh"]
network :forwarded_port,
guest: 22,
host: 2222,

View File

@ -123,6 +123,19 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
expect(n[0][1][:id]).to eq("ssh")
end
it "allows overriding SSH" do
subject.network "forwarded_port",
guest: 22, host: 14100, id: "ssh"
subject.finalize!
n = subject.networks
expect(n.length).to eq(1)
expect(n[0][0]).to eq(:forwarded_port)
expect(n[0][1][:guest]).to eq(22)
expect(n[0][1][:host]).to eq(14100)
expect(n[0][1][:id]).to eq("ssh")
end
it "turns all forwarded port ports to ints" do
subject.network "forwarded_port",
guest: "45", host: "4545", id: "test"