class HashiCorp::VagrantVMwareDesktop::Action::Suspend

This suspends the VMware machine.

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-vmware-desktop/action/suspend.rb, line 10
def initialize(app, env)
  @app = app
  @logger = Log4r::Logger.new("hashicorp::provider::vmware::suspend")
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-vmware-desktop/action/suspend.rb, line 15
def call(env)
  if env[:machine].provider.state.id == :running
    env[:ui].info(I18n.t("hashicorp.vagrant_vmware_desktop.suspending"))
    env[:machine].provider.driver.suspend
  end

  @app.call(env)
end