Check if communicator is available before detecting guests
This commit is contained in:
parent
e0a30f9ba7
commit
adadf26c9c
@ -98,6 +98,17 @@ func (m *Machine) Box() (b core.Box, err error) {
|
||||
|
||||
// Guest implements core.Machine
|
||||
func (m *Machine) Guest() (g core.Guest, err error) {
|
||||
comm, err := m.Communicate()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
isReady, err := comm.Ready(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if !isReady {
|
||||
return nil, fmt.Errorf("unable to communicate with guest")
|
||||
}
|
||||
defer func() {
|
||||
if g != nil {
|
||||
err = seedPlugin(g, m)
|
||||
|
||||
@ -85,7 +85,6 @@ module Vagrant
|
||||
end
|
||||
|
||||
def guest
|
||||
# require "pry-remote"; binding.pry_remote
|
||||
raise Errors::MachineGuestNotReady if !communicate.ready?
|
||||
if !@guest
|
||||
@guest = Guest.new(self, nil, nil)
|
||||
|
||||
@ -37,7 +37,6 @@ module VagrantPlugins
|
||||
end
|
||||
|
||||
# @return [Guest] machine guest
|
||||
# TODO: This needs to be loaded properly
|
||||
def guest
|
||||
g = client.guest(Empty.new)
|
||||
Guest.load(g, broker: broker)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user