Class: Vagrant::Actions::Box::Add

Inherits:
Vagrant::Actions::Base show all
Defined in:
lib/vagrant/actions/box/add.rb

Overview

A meta-action which adds a box by downloading and unpackaging it. This action downloads and unpackages a box with a given URI. This is a _meta action_, meaning it simply adds more actions to the action chain, and those actions do the work.

This is the action called by Box#add.

Instance Attribute Summary

Attributes inherited from Vagrant::Actions::Base

#runner

Instance Method Summary collapse

Methods inherited from Vagrant::Actions::Base

#cleanup, #execute!, #follows, #initialize, #precedes, #rescue

Methods included from Util

#error_and_exit, included, #logger, #wrap_output

Constructor Details

This class inherits a constructor from Vagrant::Actions::Base

Instance Method Details

#prepareObject



11
12
13
14
15
16
17
18
# File 'lib/vagrant/actions/box/add.rb', line 11

def prepare
  if File.exists?(@runner.directory)
    raise ActionException.new(:box_add_already_exists, :box_name => @runner.name)
  end

  @runner.add_action(Download)
  @runner.add_action(Unpackage)
end