Sha256: 0b42667d42c960ddbf83747c2ebf3ff54b815797141f73ee9b4c0fa5c1c1cc67

Contents?: true

Size: 586 Bytes

Versions: 4

Compression:

Stored size: 586 Bytes

Contents

module VagrantPlugins
  module VCloudAir
    module Action
      class Suspend
        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_vcloudair::action::suspend')
        end

        def call(env)
          cfg = env[:machine].provider_config
          cnx = cfg.vcloudair_cnx.driver

          vm_id = env[:machine].id

          env[:ui].info(I18n.t('vagrant_vcloudair.vm.suspend_vm'))
          task_id = cnx.suspend_vm(vm_id)
          cnx.wait_task_completion(task_id)

          @app.call env
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vagrant-vcloudair-0.5.3 lib/vagrant-vcloudair/action/suspend.rb
vagrant-vcloudair-0.5.2 lib/vagrant-vcloudair/action/suspend.rb
vagrant-vcloudair-0.5.1 lib/vagrant-vcloudair/action/suspend.rb
vagrant-vcloudair-0.5.0 lib/vagrant-vcloudair/action/suspend.rb