Sha256: 35e58b35c6a51a14b93d35f49617b044aa5948ba88efd8a56e9f216cdb51143d

Contents?: true

Size: 675 Bytes

Versions: 3

Compression:

Stored size: 675 Bytes

Contents

require "i18n"

module VagrantPlugins
  module VCloud
    module Action
      class Suspend

        def initialize(app, env)
          @app = app
          @logger = Log4r::Logger.new("vagrant_vcloud::action::suspend")
        end

        def call(env)

          cfg = env[:machine].provider_config
          cnx = cfg.vcloud_cnx.driver

          vAppId = env[:machine].get_vapp_id
          vmId = env[:machine].id
          vmName = env[:machine].name

          env[:ui].info("Suspending VM...")
          task_id = cnx.suspend_vm(vmId)
          wait = cnx.wait_task_completion(task_id)

          true

          @app.call env
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
vagrant-vcloud-0.1.2 lib/vagrant-vcloud/action/suspend.rb
vagrant-vcloud-0.1.1 lib/vagrant-vcloud/action/suspend.rb
vagrant-vcloud-0.1.0 lib/vagrant-vcloud/action/suspend.rb