lib/vagrant-vmware-appcatalyst/action/resume.rb in vagrant-vmware-appcatalyst-1.0.3 vs lib/vagrant-vmware-appcatalyst/action/resume.rb in vagrant-vmware-appcatalyst-1.1.0
- old
+ new
@@ -19,11 +19,18 @@
@app = app
@logger = Log4r::Logger.new('vagrant_appcatalyst::action::resume')
end
def call(env)
- env[:appcatalyst_cnx].set_vm_power(env[:machine].id, 'resume')
+ current_state = env[:machine].state.id
+ if current_state == :paused
+ env[:ui].info I18n.t('vagrant.actions.vm.resume.unpausing')
+ env[:appcatalyst_cnx].set_vm_power(env[:machine].id, 'unpause')
+ elsif current_state == :suspended
+ env[:ui].info I18n.t('vagrant.actions.vm.resume.resuming')
+ env[:appcatalyst_cnx].set_vm_power(env[:machine].id, 'on')
+ end
@app.call(env)
end
end
end
end