Sha256: 90cae751b43bdf84258e03d1bd98b10c2de2d22b717d77795b4f825ed69977ab

Contents?: true

Size: 657 Bytes

Versions: 5

Compression:

Stored size: 657 Bytes

Contents

require 'log4r'

module VagrantPlugins
  module Libvirt
    module Action
      # Resume suspended domain.
      class ResumeDomain
        def initialize(app, env)
          @logger = Log4r::Logger.new("vagrant_libvirt::action::resume_domain")
          @app = app
        end

        def call(env)
          env[:ui].info(I18n.t("vagrant_libvirt.resuming_domain"))

          domain = env[:libvirt_compute].servers.get(env[:machine].id.to_s)
          raise Errors::NoDomainError if domain == nil

          domain.resume
          @logger.info("Machine #{env[:machine].id} is resumed.")

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vagrant-libvirt-0.0.6 lib/vagrant-libvirt/action/resume_domain.rb
vagrant-libvirt-0.0.5 lib/vagrant-libvirt/action/resume_domain.rb
vagrant-libvirt-0.0.4 lib/vagrant-libvirt/action/resume_domain.rb
vagrant-libvirt-0.0.3 lib/vagrant-libvirt/action/resume_domain.rb
vagrant-libvirt-0.0.2 lib/vagrant-libvirt/action/resume_domain.rb