issue-7983 - Helper now throws WinRMNotReady exception is host ip is reported as an empty string
This commit is contained in:
parent
f37b0c26e8
commit
e4626d088d
|
@ -33,7 +33,7 @@ module VagrantPlugins
|
||||||
return addr if addr
|
return addr if addr
|
||||||
|
|
||||||
ssh_info = machine.ssh_info
|
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]
|
return ssh_info[:host]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,12 @@ describe VagrantPlugins::CommunicatorWinRM::Helper do
|
||||||
expect { subject.winrm_address(machine) }.
|
expect { subject.winrm_address(machine) }.
|
||||||
to raise_error(VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady)
|
to raise_error(VagrantPlugins::CommunicatorWinRM::Errors::WinRMNotReady)
|
||||||
end
|
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
|
end
|
||||||
|
|
||||||
describe ".winrm_info" do
|
describe ".winrm_info" do
|
||||||
|
|
Loading…
Reference in New Issue