core: Use Machine#state wherever possible so we update the index
This commit is contained in:
parent
e14216da4e
commit
9a16af10ad
|
@ -33,7 +33,7 @@ module Vagrant
|
|||
|
||||
# Otherwise, periodically verify the VM isn't in a bad state.
|
||||
while true
|
||||
state = env[:machine].provider.state.id
|
||||
state = env[:machine].state.id
|
||||
|
||||
# Used to report invalid states
|
||||
Thread.current[:last_known_state] = state
|
||||
|
|
|
@ -7,7 +7,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def call(env)
|
||||
if env[:machine].provider.state.id == :saved
|
||||
if env[:machine].state.id == :saved
|
||||
env[:ui].info I18n.t("vagrant.actions.vm.discard_state.discarding")
|
||||
env[:machine].provider.driver.discard_saved_state
|
||||
end
|
||||
|
|
|
@ -12,7 +12,7 @@ module VagrantPlugins
|
|||
@env = env
|
||||
|
||||
raise Vagrant::Errors::VMPowerOffToPackage if \
|
||||
@env[:machine].provider.state.id != :poweroff
|
||||
@env[:machine].state.id != :poweroff
|
||||
|
||||
export
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def recover(env)
|
||||
if env[:machine].provider.state.id != :not_created
|
||||
if env[:machine].state.id != :not_created
|
||||
return if env["vagrant.error"].is_a?(Vagrant::Errors::VagrantError)
|
||||
|
||||
# If we're not supposed to destroy on error then just return
|
||||
|
|
|
@ -7,7 +7,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def call(env)
|
||||
current_state = env[:machine].provider.state.id
|
||||
current_state = env[:machine].state.id
|
||||
|
||||
if current_state == :paused
|
||||
env[:ui].info I18n.t("vagrant.actions.vm.resume.unpausing")
|
||||
|
|
|
@ -7,7 +7,7 @@ module VagrantPlugins
|
|||
end
|
||||
|
||||
def call(env)
|
||||
if env[:machine].provider.state.id == :running
|
||||
if env[:machine].state.id == :running
|
||||
env[:ui].info I18n.t("vagrant.actions.vm.suspend.suspending")
|
||||
env[:machine].provider.driver.suspend
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue