vagrant 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. data/Gemfile +4 -4
  2. data/Rakefile +3 -3
  3. data/VERSION +1 -1
  4. data/bin/vagrant +5 -13
  5. data/config/default.rb +1 -0
  6. data/keys/README.md +8 -1
  7. data/keys/vagrant.ppk +26 -0
  8. data/lib/vagrant.rb +3 -3
  9. data/lib/vagrant/actions/base.rb +15 -4
  10. data/lib/vagrant/actions/box/add.rb +1 -1
  11. data/lib/vagrant/actions/box/download.rb +72 -66
  12. data/lib/vagrant/actions/box/unpackage.rb +1 -4
  13. data/lib/vagrant/actions/runner.rb +1 -1
  14. data/lib/vagrant/actions/vm/boot.rb +5 -7
  15. data/lib/vagrant/actions/vm/customize.rb +2 -2
  16. data/lib/vagrant/actions/vm/destroy.rb +2 -2
  17. data/lib/vagrant/actions/vm/down.rb +7 -0
  18. data/lib/vagrant/actions/vm/export.rb +10 -4
  19. data/lib/vagrant/actions/vm/forward_ports.rb +5 -15
  20. data/lib/vagrant/actions/vm/halt.rb +5 -3
  21. data/lib/vagrant/actions/vm/import.rb +10 -3
  22. data/lib/vagrant/actions/vm/move_hard_drive.rb +1 -3
  23. data/lib/vagrant/actions/vm/package.rb +33 -10
  24. data/lib/vagrant/actions/vm/provision.rb +4 -4
  25. data/lib/vagrant/actions/vm/reload.rb +1 -1
  26. data/lib/vagrant/actions/vm/resume.rb +1 -1
  27. data/lib/vagrant/actions/vm/shared_folders.rb +7 -7
  28. data/lib/vagrant/actions/vm/start.rb +3 -2
  29. data/lib/vagrant/actions/vm/suspend.rb +2 -2
  30. data/lib/vagrant/actions/vm/up.rb +7 -17
  31. data/lib/vagrant/active_list.rb +52 -45
  32. data/lib/vagrant/box.rb +18 -11
  33. data/lib/vagrant/busy.rb +7 -0
  34. data/lib/vagrant/command.rb +27 -0
  35. data/lib/vagrant/commands/base.rb +163 -0
  36. data/lib/vagrant/commands/box.rb +16 -0
  37. data/lib/vagrant/commands/box/add.rb +24 -0
  38. data/lib/vagrant/commands/box/list.rb +30 -0
  39. data/lib/vagrant/commands/box/remove.rb +31 -0
  40. data/lib/vagrant/commands/destroy.rb +23 -0
  41. data/lib/vagrant/commands/down.rb +16 -0
  42. data/lib/vagrant/commands/halt.rb +23 -0
  43. data/lib/vagrant/commands/init.rb +32 -0
  44. data/lib/vagrant/commands/package.rb +46 -0
  45. data/lib/vagrant/commands/reload.rb +22 -0
  46. data/lib/vagrant/commands/resume.rb +22 -0
  47. data/lib/vagrant/commands/ssh.rb +22 -0
  48. data/lib/vagrant/commands/ssh_config.rb +30 -0
  49. data/lib/vagrant/commands/status.rb +58 -0
  50. data/lib/vagrant/commands/suspend.rb +23 -0
  51. data/lib/vagrant/commands/up.rb +26 -0
  52. data/lib/vagrant/config.rb +21 -11
  53. data/lib/vagrant/downloaders/file.rb +5 -5
  54. data/lib/vagrant/downloaders/http.rb +10 -15
  55. data/lib/vagrant/environment.rb +259 -0
  56. data/lib/vagrant/provisioners/base.rb +7 -0
  57. data/lib/vagrant/provisioners/chef.rb +24 -9
  58. data/lib/vagrant/provisioners/chef_server.rb +23 -48
  59. data/lib/vagrant/provisioners/chef_solo.rb +48 -22
  60. data/lib/vagrant/ssh.rb +95 -46
  61. data/lib/vagrant/util.rb +2 -2
  62. data/lib/vagrant/util/errors.rb +36 -0
  63. data/lib/vagrant/util/platform.rb +12 -0
  64. data/lib/vagrant/util/progress_meter.rb +33 -0
  65. data/lib/vagrant/util/stacked_proc_runner.rb +35 -0
  66. data/lib/vagrant/util/template_renderer.rb +83 -0
  67. data/lib/vagrant/vm.rb +1 -0
  68. data/templates/{Vagrantfile → Vagrantfile.erb} +2 -2
  69. data/templates/chef_server_client.erb +16 -0
  70. data/templates/chef_solo_solo.erb +4 -0
  71. data/templates/errors.yml +157 -0
  72. data/templates/package_Vagrantfile.erb +11 -0
  73. data/templates/ssh_config.erb +7 -0
  74. data/test/test_helper.rb +12 -15
  75. data/test/vagrant/actions/box/add_test.rb +1 -2
  76. data/test/vagrant/actions/box/destroy_test.rb +0 -1
  77. data/test/vagrant/actions/box/download_test.rb +40 -15
  78. data/test/vagrant/actions/box/unpackage_test.rb +2 -3
  79. data/test/vagrant/actions/collection_test.rb +8 -5
  80. data/test/vagrant/actions/runner_test.rb +8 -6
  81. data/test/vagrant/actions/vm/boot_test.rb +12 -11
  82. data/test/vagrant/actions/vm/customize_test.rb +2 -3
  83. data/test/vagrant/actions/vm/destroy_test.rb +2 -3
  84. data/test/vagrant/actions/vm/down_test.rb +16 -3
  85. data/test/vagrant/actions/vm/export_test.rb +4 -5
  86. data/test/vagrant/actions/vm/forward_ports_test.rb +6 -5
  87. data/test/vagrant/actions/vm/halt_test.rb +8 -2
  88. data/test/vagrant/actions/vm/import_test.rb +5 -5
  89. data/test/vagrant/actions/vm/move_hard_drive_test.rb +4 -6
  90. data/test/vagrant/actions/vm/package_test.rb +60 -22
  91. data/test/vagrant/actions/vm/provision_test.rb +7 -16
  92. data/test/vagrant/actions/vm/reload_test.rb +3 -2
  93. data/test/vagrant/actions/vm/resume_test.rb +0 -1
  94. data/test/vagrant/actions/vm/shared_folders_test.rb +17 -12
  95. data/test/vagrant/actions/vm/start_test.rb +10 -3
  96. data/test/vagrant/actions/vm/suspend_test.rb +1 -2
  97. data/test/vagrant/actions/vm/up_test.rb +19 -11
  98. data/test/vagrant/active_list_test.rb +148 -129
  99. data/test/vagrant/box_test.rb +26 -14
  100. data/test/vagrant/busy_test.rb +15 -6
  101. data/test/vagrant/command_test.rb +53 -0
  102. data/test/vagrant/commands/base_test.rb +118 -0
  103. data/test/vagrant/commands/box/add_test.rb +34 -0
  104. data/test/vagrant/commands/box/list_test.rb +32 -0
  105. data/test/vagrant/commands/box/remove_test.rb +41 -0
  106. data/test/vagrant/commands/destroy_test.rb +32 -0
  107. data/test/vagrant/commands/down_test.rb +17 -0
  108. data/test/vagrant/commands/halt_test.rb +28 -0
  109. data/test/vagrant/commands/init_test.rb +55 -0
  110. data/test/vagrant/commands/package_test.rb +84 -0
  111. data/test/vagrant/commands/reload_test.rb +28 -0
  112. data/test/vagrant/commands/resume_test.rb +33 -0
  113. data/test/vagrant/commands/ssh_config_test.rb +54 -0
  114. data/test/vagrant/commands/ssh_test.rb +32 -0
  115. data/test/vagrant/commands/status_test.rb +20 -0
  116. data/test/vagrant/commands/suspend_test.rb +33 -0
  117. data/test/vagrant/commands/up_test.rb +41 -0
  118. data/test/vagrant/config_test.rb +42 -17
  119. data/test/vagrant/downloaders/file_test.rb +7 -0
  120. data/test/vagrant/downloaders/http_test.rb +12 -0
  121. data/test/vagrant/environment_test.rb +595 -0
  122. data/test/vagrant/provisioners/base_test.rb +7 -1
  123. data/test/vagrant/provisioners/chef_server_test.rb +41 -51
  124. data/test/vagrant/provisioners/chef_solo_test.rb +93 -62
  125. data/test/vagrant/provisioners/chef_test.rb +61 -15
  126. data/test/vagrant/ssh_test.rb +166 -38
  127. data/test/vagrant/util/errors_test.rb +57 -0
  128. data/test/vagrant/util/progress_meter_test.rb +33 -0
  129. data/test/vagrant/{stacked_proc_runner_test.rb → util/stacked_proc_runner_test.rb} +3 -3
  130. data/test/vagrant/util/template_renderer_test.rb +138 -0
  131. data/test/vagrant/vm_test.rb +3 -2
  132. data/vagrant.gemspec +88 -33
  133. metadata +94 -51
  134. data/bin/vagrant-box +0 -34
  135. data/bin/vagrant-down +0 -27
  136. data/bin/vagrant-halt +0 -28
  137. data/bin/vagrant-init +0 -27
  138. data/bin/vagrant-package +0 -29
  139. data/bin/vagrant-reload +0 -29
  140. data/bin/vagrant-resume +0 -27
  141. data/bin/vagrant-ssh +0 -27
  142. data/bin/vagrant-status +0 -29
  143. data/bin/vagrant-suspend +0 -27
  144. data/bin/vagrant-up +0 -29
  145. data/lib/vagrant/commands.rb +0 -234
  146. data/lib/vagrant/env.rb +0 -189
  147. data/lib/vagrant/stacked_proc_runner.rb +0 -33
  148. data/test/vagrant/commands_test.rb +0 -269
  149. data/test/vagrant/env_test.rb +0 -418
@@ -0,0 +1,32 @@
1
+ module Vagrant
2
+ class Commands
3
+ class Init < Base
4
+ Base.subcommand "init", self
5
+ description "Initializes current folder for Vagrant usage"
6
+
7
+ def execute(args)
8
+ create_vagrantfile(args[0])
9
+ end
10
+
11
+ def options_spec(opts)
12
+ opts.banner = "Usage: vagrant init [name]"
13
+ end
14
+
15
+ # Actually writes the initial Vagrantfile to the current working directory.
16
+ # The Vagrantfile will contain the base box configuration specified, or
17
+ # will just use "base" if none is specified.
18
+ #
19
+ # @param [String] default_box The default base box for this Vagrantfile
20
+ def create_vagrantfile(default_box=nil)
21
+ rootfile_path = File.join(Dir.pwd, Environment::ROOTFILE_NAME)
22
+ error_and_exit(:rootfile_already_exists) if File.exist?(rootfile_path)
23
+
24
+ # Copy over the rootfile template into this directory
25
+ default_box ||= "base"
26
+ File.open(rootfile_path, 'w+') do |f|
27
+ f.write(TemplateRenderer.render(Environment::ROOTFILE_NAME, :default_box => default_box))
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,46 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Export and package the current vm
4
+ #
5
+ # This command requires that an instance be powered off
6
+ class Package < Base
7
+ Base.subcommand "package", self
8
+ description "Packages a vagrant environment for distribution"
9
+
10
+ def execute(args=[])
11
+ parse_options(args)
12
+
13
+ if !options[:base]
14
+ # Packaging a pre-existing environment
15
+ env.require_persisted_vm
16
+ else
17
+ # Packaging a base box; that is a VM not tied to a specific
18
+ # vagrant environment
19
+ vm = VM.find(options[:base])
20
+ vm.env = env if vm
21
+ env.vm = vm
22
+
23
+ error_and_exit(:vm_base_not_found, :name => options[:base]) unless vm
24
+ end
25
+
26
+ error_and_exit(:vm_power_off_to_package) unless env.vm.powered_off?
27
+ env.vm.package(args[0], options[:include])
28
+ end
29
+
30
+ def options_spec(opts)
31
+ opts.banner = "Usage: vagrant package [--base BASE] [--include FILES]"
32
+
33
+ # Defaults
34
+ options[:include] = []
35
+
36
+ opts.on("--base [BASE]", "Name or UUID of VM to create a base box from") do |v|
37
+ options[:base] = v
38
+ end
39
+
40
+ opts.on("--include x,y,z", Array, "List of files to include in the package") do |v|
41
+ options[:include] = v
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
@@ -0,0 +1,22 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Reload the environment. This is almost equivalent to the {up} command
4
+ # except that it doesn't import the VM and do the initialize bootstrapping
5
+ # of the instance. Instead, it forces a shutdown (if its running) of the
6
+ # VM, updates the metadata (shared folders, forwarded ports), restarts
7
+ # the VM, and then reruns the provisioning if enabled.
8
+ class Reload < Base
9
+ Base.subcommand "reload", self
10
+ description "Reload the vagrant environment"
11
+
12
+ def execute(args=[])
13
+ env.require_persisted_vm
14
+ env.vm.execute!(Actions::VM::Reload)
15
+ end
16
+
17
+ def options_spec(opts)
18
+ opts.banner = "Usage: vagrant reload"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Resume a running vagrant instance. This resumes an already suspended
4
+ # instance (from {suspend}).
5
+ #
6
+ # This command requires that an instance already be brought up with
7
+ # `vagrant up`.
8
+ class Resume < Base
9
+ Base.subcommand "resume", self
10
+ description "Resumes a suspend vagrant environment"
11
+
12
+ def execute(args=[])
13
+ env.require_persisted_vm
14
+ env.vm.resume
15
+ end
16
+
17
+ def options_spec(opts)
18
+ opts.banner = "Usage: vagrant resume"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Reload the environment. This is almost equivalent to the {up} command
4
+ # except that it doesn't import the VM and do the initialize bootstrapping
5
+ # of the instance. Instead, it forces a shutdown (if its running) of the
6
+ # VM, updates the metadata (shared folders, forwarded ports), restarts
7
+ # the VM, and then reruns the provisioning if enabled.
8
+ class SSH < Base
9
+ Base.subcommand "ssh", self
10
+ description "SSH into the currently running environment"
11
+
12
+ def execute(args=[])
13
+ env.require_persisted_vm
14
+ env.ssh.connect
15
+ end
16
+
17
+ def options_spec(opts)
18
+ opts.banner = "Usage: vagrant ssh"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,30 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Outputs a valid entry for .ssh/config which can be used to connect
4
+ # to this environment.
5
+ class SSHConfig < Base
6
+ Base.subcommand "ssh-config", self
7
+ description "outputs .ssh/config valid syntax for connecting to this environment via ssh"
8
+
9
+ def execute(args=[])
10
+ env.require_root_path
11
+
12
+ parse_options(args)
13
+ puts TemplateRenderer.render("ssh_config", {
14
+ :host_key => options[:host] || "vagrant",
15
+ :ssh_user => env.config.ssh.username,
16
+ :ssh_port => env.ssh.port,
17
+ :private_key_path => env.config.ssh.private_key_path
18
+ })
19
+ end
20
+
21
+ def options_spec(opts)
22
+ opts.banner = "Usage: vagrant ssh-config [--host NAME]"
23
+
24
+ opts.on("-h", "--host [HOST]", "Host name for the SSH config") do |h|
25
+ options[:host] = h
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,58 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Outputs the status of the current environment. This command outputs
4
+ # useful information such as whether or not the environment is created
5
+ # and if its running, suspended, etc.
6
+ class Status < Base
7
+ Base.subcommand "status", self
8
+ description "Shows the status of the current environment."
9
+
10
+ def execute(args=[])
11
+ wrap_output do
12
+ if !env.root_path
13
+ puts <<-msg
14
+ No vagrant environment detected. Run `vagrant init` to setup a Vagrantfile
15
+ in the current directory to get started with Vagrant.
16
+ msg
17
+ elsif !env.vm
18
+ puts <<-msg
19
+ The environment has not yet been created. Run `vagrant up` to create the
20
+ environment.
21
+ msg
22
+ else
23
+ additional_msg = ""
24
+ if env.vm.vm.running?
25
+ additional_msg = <<-msg
26
+ To stop this VM, you can run `vagrant halt` to shut it down forcefully,
27
+ or you can run `vagrant suspend` to simply suspend the virtual machine.
28
+ In either case, to restart it again, simply run a `vagrant up`.
29
+ msg
30
+ elsif env.vm.vm.saved?
31
+ additional_msg = <<-msg
32
+ To resume this VM, simply run `vagrant up`.
33
+ msg
34
+ elsif env.vm.vm.powered_off?
35
+ additional_msg = <<-msg
36
+ To restart this VM, simply run `vagrant up`.
37
+ msg
38
+ end
39
+
40
+ if !additional_msg.empty?
41
+ additional_msg.chomp!
42
+ additional_msg = "\n\n#{additional_msg}"
43
+ end
44
+
45
+ puts <<-msg
46
+ The environment has been created. The status of the current environment's
47
+ virtual machine is: "#{env.vm.vm.state}."#{additional_msg}
48
+ msg
49
+ end
50
+ end
51
+ end
52
+
53
+ def options_spec(opts)
54
+ opts.banner = "Usage: vagrant status"
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,23 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Suspend a running vagrant instance. This suspends the instance, saving
4
+ # the state of the VM and "pausing" it. The instance can be resumed
5
+ # again with {resume}.
6
+ #
7
+ # This command requires that an instance already be brought up with
8
+ # `vagrant up`.
9
+ class Suspend < Base
10
+ Base.subcommand "suspend", self
11
+ description "Suspends the currently running vagrant environment"
12
+
13
+ def execute(args=[])
14
+ env.require_persisted_vm
15
+ env.vm.suspend
16
+ end
17
+
18
+ def options_spec(opts)
19
+ opts.banner = "Usage: vagrant suspend"
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,26 @@
1
+ module Vagrant
2
+ class Commands
3
+ # Bring up a vagrant instance. This handles everything from importing
4
+ # the base VM, setting up shared folders, forwarded ports, etc to
5
+ # provisioning the instance with chef. {up} also starts the instance,
6
+ # running it in the background.
7
+ class Up < Base
8
+ Base.subcommand "up", self
9
+ description "Creates the vagrant environment"
10
+
11
+ def execute(args=[])
12
+ if env.vm
13
+ logger.info "VM already created. Starting VM if its not already running..."
14
+ env.vm.start
15
+ else
16
+ env.require_box
17
+ env.create_vm.execute!(Actions::VM::Up)
18
+ end
19
+ end
20
+
21
+ def options_spec(opts)
22
+ opts.banner = "Usage: vagrant up"
23
+ end
24
+ end
25
+ end
26
+ end
@@ -4,22 +4,25 @@ module Vagrant
4
4
  end
5
5
 
6
6
  class Config
7
- extend StackedProcRunner
7
+ extend Util::StackedProcRunner
8
8
 
9
9
  @@config = nil
10
10
 
11
11
  class << self
12
- def reset!
12
+ def reset!(env=nil)
13
13
  @@config = nil
14
14
  proc_stack.clear
15
+
16
+ # Reset the configuration to the specified environment
17
+ config(env)
15
18
  end
16
19
 
17
20
  def configures(key, klass)
18
21
  config.class.configures(key, klass)
19
22
  end
20
23
 
21
- def config
22
- @@config ||= Config::Top.new
24
+ def config(env=nil)
25
+ @@config ||= Config::Top.new(env)
23
26
  end
24
27
 
25
28
  def run(&block)
@@ -29,12 +32,15 @@ module Vagrant
29
32
  def execute!
30
33
  run_procs!(config)
31
34
  config.loaded!
35
+ config
32
36
  end
33
37
  end
34
38
  end
35
39
 
36
40
  class Config
37
41
  class Base
42
+ attr_accessor :env
43
+
38
44
  def [](key)
39
45
  send(key)
40
46
  end
@@ -45,7 +51,7 @@ module Vagrant
45
51
 
46
52
  def instance_variables_hash
47
53
  instance_variables.inject({}) do |acc, iv|
48
- acc[iv.to_s[1..-1].to_sym] = instance_variable_get(iv)
54
+ acc[iv.to_s[1..-1].to_sym] = instance_variable_get(iv) unless iv.to_sym == :@env
49
55
  acc
50
56
  end
51
57
  end
@@ -61,16 +67,17 @@ module Vagrant
61
67
  attr_accessor :private_key_path
62
68
 
63
69
  def private_key_path
64
- File.expand_path(@private_key_path, Env.root_path)
70
+ File.expand_path(@private_key_path, env.root_path)
65
71
  end
66
72
  end
67
73
 
68
74
  class VMConfig < Base
69
- include StackedProcRunner
75
+ include Util::StackedProcRunner
70
76
 
71
77
  attr_accessor :box
72
78
  attr_accessor :box_ovf
73
79
  attr_accessor :base_mac
80
+ attr_accessor :boot_mode
74
81
  attr_accessor :project_directory
75
82
  attr_reader :forwarded_ports
76
83
  attr_reader :shared_folders
@@ -107,11 +114,11 @@ module Vagrant
107
114
  end
108
115
 
109
116
  def shared_folder_uid
110
- @shared_folder_uid || Vagrant.config.ssh.username
117
+ @shared_folder_uid || env.config.ssh.username
111
118
  end
112
119
 
113
120
  def shared_folder_gid
114
- @shared_folder_gid || Vagrant.config.ssh.username
121
+ @shared_folder_gid || env.config.ssh.username
115
122
  end
116
123
 
117
124
  def customize(&block)
@@ -154,12 +161,15 @@ module Vagrant
154
161
  configures :vm, VMConfig
155
162
  configures :vagrant, VagrantConfig
156
163
 
157
- def initialize
164
+ def initialize(env=nil)
158
165
  self.class.configures_list.each do |key, klass|
159
- instance_variable_set("@#{key}".to_sym, klass.new)
166
+ config = klass.new
167
+ config.env = env
168
+ instance_variable_set("@#{key}".to_sym, config)
160
169
  end
161
170
 
162
171
  @loaded = false
172
+ @env = env
163
173
  end
164
174
 
165
175
  def loaded?
@@ -3,13 +3,13 @@ module Vagrant
3
3
  # "Downloads" a file to a temporary file. Basically, this downloader
4
4
  # simply does a file copy.
5
5
  class File < Base
6
+ def self.match?(uri)
7
+ ::File.exists?(uri)
8
+ end
9
+
6
10
  def prepare(source_url)
7
11
  if !::File.file?(source_url)
8
- raise Actions::ActionException.new(<<-msg)
9
- The given box does not exist on the file system:
10
-
11
- #{source_url}
12
- msg
12
+ raise Actions::ActionException.new(:downloader_file_doesnt_exist, :source_url => source_url)
13
13
  end
14
14
  end
15
15
 
@@ -3,8 +3,14 @@ module Vagrant
3
3
  # Downloads a file from an HTTP URL to a temporary file. This
4
4
  # downloader reports its progress to stdout while downloading.
5
5
  class HTTP < Base
6
- # ANSI escape code to clear lines from cursor to end of line
7
- CL_RESET = "\r\e[0K"
6
+ include Util::ProgressMeter
7
+
8
+ def self.match?(uri)
9
+ # URI.parse barfs on '<drive letter>:\\files \on\ windows'
10
+ # TODO temprorary
11
+ extracted = URI.extract(uri).first
12
+ extracted && extracted.include?(uri)
13
+ end
8
14
 
9
15
  def download!(source_url, destination_file)
10
16
  Net::HTTP.get_response(URI.parse(source_url)) do |response|
@@ -20,7 +26,7 @@ module Vagrant
20
26
  # Progress reporting is limited to every 25 segments just so
21
27
  # we're not constantly updating
22
28
  if segment_count % 25 == 0
23
- report_progress(progress, total)
29
+ update_progress(progress, total)
24
30
  segment_count = 0
25
31
  end
26
32
 
@@ -31,17 +37,6 @@ module Vagrant
31
37
 
32
38
  complete_progress
33
39
  end
34
-
35
- def report_progress(progress, total)
36
- percent = (progress.to_f / total.to_f) * 100
37
- print "#{CL_RESET}Download Progress: #{percent.to_i}% (#{progress} / #{total})"
38
- $stdout.flush
39
- end
40
-
41
- def complete_progress
42
- # Just clear the line back out
43
- print "#{CL_RESET}"
44
- end
45
40
  end
46
41
  end
47
- end
42
+ end