Sha256: 0dc9c62c3f29daa571e9bfe67d7059e46148833bdd4b5aec63e2d740d2c803d9

Contents?: true

Size: 727 Bytes

Versions: 1

Compression:

Stored size: 727 Bytes

Contents

require 'log4r'

module VagrantPlugins
  module ProviderLibvirt
    module Action

      # Just start the domain.
      class StartDomain
        def initialize(app, env)
          @logger = Log4r::Logger.new("vagrant_libvirt::action::start_domain")
          @app = app
        end

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

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

          begin
            domain.start
          rescue => e
            raise Errors::FogError, :message => e.message
          end

          @app.call(env)
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vagrant-libvirt-0.0.31 lib/vagrant-libvirt/action/start_domain.rb