Merge pull request #8073 from bshurts/fix/issue-7983

HyperV inaccurate winrm address - issue-7983
This commit is contained in:
Chris Roberts 2017-03-06 09:11:34 -08:00 committed by GitHub
commit 6631fbdb9b
2 changed files with 7 additions and 1 deletions

View File

@ -33,7 +33,7 @@ module VagrantPlugins
return addr if addr
ssh_info = machine.ssh_info
raise Errors::WinRMNotReady if !ssh_info
raise Errors::WinRMNotReady if !ssh_info || ssh_info[:host].empty?
return ssh_info[:host]
end

View File

@ -36,6 +36,12 @@ describe VagrantPlugins::CommunicatorWinRM::Helper do
expect { subject.winrm_address(machine) }.
to raise_error(VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady)
end
it "raise an exception if it detects an empty host ip" do
machine.stub(ssh_info: { host: "" })
expect { subject.winrm_address(machine) }.
to raise_error(VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady)
end
end
describe ".winrm_info" do