diff --git a/lib/vagrant/actions/box/add.rb b/lib/vagrant/actions/box/add.rb index 1786834e6..b46ba2c3d 100644 --- a/lib/vagrant/actions/box/add.rb +++ b/lib/vagrant/actions/box/add.rb @@ -2,14 +2,8 @@ module Vagrant module Actions module Box class Add < Base - def initialize(runner, name, path, *args) - super - @name = name - @uri = path - end - def prepare - @runner.add_action(Download, @uri) + @runner.add_action(Download) end end end diff --git a/lib/vagrant/actions/box/download.rb b/lib/vagrant/actions/box/download.rb index 0fbaee608..4d394e00a 100644 --- a/lib/vagrant/actions/box/download.rb +++ b/lib/vagrant/actions/box/download.rb @@ -7,11 +7,6 @@ module Vagrant BASENAME = "box" BUFFERSIZE = 1048576 # 1 MB - def initialize(runner, uri, *args) - super - @uri = uri - end - def execute! with_tempfile do |tempfile| copy_uri_to(tempfile) @@ -27,7 +22,7 @@ module Vagrant def copy_uri_to(f) logger.info "Copying box to temporary location..." - open(@uri) do |remote_file| + open(@runner.uri) do |remote_file| loop do break if remote_file.eof? f.write(remote_file.read(BUFFERSIZE)) diff --git a/lib/vagrant/box.rb b/lib/vagrant/box.rb index bc38c0e79..3be3223e6 100644 --- a/lib/vagrant/box.rb +++ b/lib/vagrant/box.rb @@ -1,5 +1,20 @@ module Vagrant class Box < Actions::Runner + attr_accessor :name + attr_accessor :uri + attr_accessor :temp_path + class <