class VagrantPlugins::ProviderLibvirt::Action::StartDomain

Just start the domain.

Public Class Methods

new(app, env) click to toggle source
# File lib/vagrant-libvirt/action/start_domain.rb, line 9
def initialize(app, env)
  @logger = Log4r::Logger.new("vagrant_libvirt::action::start_domain")
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/vagrant-libvirt/action/start_domain.rb, line 14
def call(env)
  env[:ui].info(I18n.t("vagrant_libvirt.starting_domain"))

  domain = env[:libvirt_compute].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