communicators/winrm: don't look up forwarded port if non-local [GH-3861]
This commit is contained in:
parent
3c4e129fb8
commit
690c119ae2
|
@ -19,6 +19,8 @@ BUG FIXES:
|
|||
crash. [GH-3827]
|
||||
- guests/windows: Private networks with static IPs work when there
|
||||
is more than one. [GH-3818]
|
||||
- guests/windows: Don't look up a forwarded port for WinRM if we're
|
||||
not accessing the local host. [GH-3861]
|
||||
- providers/docker: Never do graceful shutdown, always use
|
||||
`docker stop`. [GH-3798]
|
||||
- providers/docker: Better error messaging when SSH is not ready
|
||||
|
|
|
@ -107,7 +107,8 @@ module VagrantPlugins
|
|||
# about this machine.
|
||||
def create_shell
|
||||
host_address = Helper.winrm_address(@machine)
|
||||
host_port = Helper.winrm_port(@machine)
|
||||
host_port = Helper.winrm_port(
|
||||
@machine, host_address == "127.0.0.1")
|
||||
|
||||
WinRMShell.new(
|
||||
host_address,
|
||||
|
|
|
@ -22,9 +22,13 @@ module VagrantPlugins
|
|||
#
|
||||
# @param [Vagrant::Machine] machine
|
||||
# @return [Integer]
|
||||
def self.winrm_port(machine)
|
||||
def self.winrm_port(machine, local=true)
|
||||
host_port = machine.config.winrm.port
|
||||
if machine.config.winrm.guest_port
|
||||
# If we're not requesting a local port, return
|
||||
# the guest port directly.
|
||||
return machine.config.winrm.guest_port if !local
|
||||
|
||||
# Search by guest port if we can. We use a provider capability
|
||||
# if we have it. Otherwise, we just scan the Vagrantfile defined
|
||||
# ports.
|
||||
|
|
Loading…
Reference in New Issue