Sha256: 63123ea2c83f8a5f65facfccbbacd3d90e16e79cc8a9a1107507ef478bb7dcca

Contents?: true

Size: 791 Bytes

Versions: 1

Compression:

Stored size: 791 Bytes

Contents

require 'vagrant-deltacloud-provider/action/abstract_action'
require 'vagrant-deltacloud-provider/client/deltacloud'

module VagrantPlugins
  module Deltacloud
    module Action
      class Resume < AbstractAction
        def initialize(app, _env)
          @app = app
          @logger = Log4r::Logger.new('vagrant_deltacloud::action::resume_server')
        end

        def execute(env)
          env[:deltacloud_client] = Deltacloud::DeltacloudClient.instance
          if env[:machine].id
            @logger.info "Resuming suspended VM #{env[:machine].id}..."
            env[:ui].info I18n.t('vagrant.actions.vm.resume.resuming')
            env[:deltacloud_client].start_instance(env, env[:machine].id)
          end

          @app.call(env)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-deltacloud-provider-0.0.9 lib/vagrant-deltacloud-provider/action/resume.rb